Skip to content

Commit

Permalink
fixup: check the uv_handle_type
Browse files Browse the repository at this point in the history
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
  • Loading branch information
daeyeon committed Jun 27, 2022
1 parent 8a7c26f commit ed77f33
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,13 @@ Maybe<void> LibuvStreamWrap::OnUvRead(ssize_t nread, const uv_buf_t* buf) {
}

Local<Object> local_pending_obj;
if (pending_obj.ToLocal(&local_pending_obj) &&
object()->Set(env()->context(),
env()->pending_handle_string(),
local_pending_obj).IsNothing()) {
if (type != UV_UNKNOWN_HANDLE &&
(!pending_obj.ToLocal(&local_pending_obj) ||
object()
->Set(env()->context(),
env()->pending_handle_string(),
local_pending_obj)
.IsNothing())) {
return Nothing<void>();
}
}
Expand Down

0 comments on commit ed77f33

Please sign in to comment.