Skip to content

Commit 83cafe8

Browse files
committed
fixup: check the uv_handle_type
Signed-off-by: Daeyeon Jeong [email protected]
1 parent 8a7c26f commit 83cafe8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/stream_wrap.cc

+7-4
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,13 @@ Maybe<void> LibuvStreamWrap::OnUvRead(ssize_t nread, const uv_buf_t* buf) {
270270
}
271271

272272
Local<Object> local_pending_obj;
273-
if (pending_obj.ToLocal(&local_pending_obj) &&
274-
object()->Set(env()->context(),
275-
env()->pending_handle_string(),
276-
local_pending_obj).IsNothing()) {
273+
if (type != UV_UNKNOWN_HANDLE &&
274+
(!pending_obj.ToLocal(&local_pending_obj) ||
275+
object()
276+
->Set(env()->context(),
277+
env()->pending_handle_string(),
278+
local_pending_obj)
279+
.IsNothing())) {
277280
return Nothing<void>();
278281
}
279282
}

0 commit comments

Comments
 (0)