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
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 MylesBorins committed Dec 17, 2018
1 parent d1a98a8 commit c6388edf34394cddce7f4d77d29f0220b411e31a
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/uv.cc
@@ -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

0 comments on commit c6388ed

Please sign in to comment.