Skip to content

Commit

Permalink
src: handle empty Maybe in uv binding initialize
Browse files Browse the repository at this point in the history
This can fail when terminating a Worker that loads
the `uv` binding at the same time.

Refs: nodejs#25061 (comment)
  • Loading branch information
addaleax committed Dec 17, 2018
1 parent 02b66b5 commit 553eb42
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/uv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ void Initialize(Local<Object> target,
OneByteString(isolate, #name), \
OneByteString(isolate, msg) \
}; \
err_map->Set(context, \
Integer::New(isolate, UV_##name), \
Array::New(isolate, arr, arraysize(arr))).ToLocalChecked(); \
if (err_map->Set(context, \
Integer::New(isolate, UV_##name), \
Array::New(isolate, arr, arraysize(arr))).IsEmpty()) { \
return; \
} \
} while (0);
UV_ERRNO_MAP(V)
#undef V
Expand Down

0 comments on commit 553eb42

Please sign in to comment.