Skip to content
Permalink
Browse files

src: handle empty Maybe in uv binding initialize

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 <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information...
addaleax authored and BethGriggs committed Dec 17, 2018
1 parent f332265 commit 0339fba1bb39535517176978815b892ae70882ed
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/uv.cc
@@ -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

0 comments on commit 0339fba

Please sign in to comment.
You can’t perform that action at this time.