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: #25061 (comment)
Fixes: #25134
PR-URL: #25079
Backport-PR-URL: #28832
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
addaleax authored and Trott committed Jul 26, 2019
1 parent 4a607fa commit ca4a22e
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 @@ -71,9 +71,11 @@ void Initialize(Local<Object> target,
Local<Array> arr = Array::New(isolate, 2); \
arr->Set(0, OneByteString(isolate, #name)); \
arr->Set(1, OneByteString(isolate, msg)); \
err_map->Set(context, \
Integer::New(isolate, UV_##name), \
arr).ToLocalChecked(); \
if (err_map->Set(context, \
Integer::New(isolate, UV_##name), \
arr).IsEmpty()) { \
return; \
} \
} while (0);
UV_ERRNO_MAP(V)
#undef V
Expand Down

0 comments on commit ca4a22e

Please sign in to comment.