Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-12-17 04:22:35 +0300
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2019-07-30 22:45:45 +0300
commit0339fba1bb39535517176978815b892ae70882ed (patch)
treef94a761413086439e0065ab3c500360cc83dcb49 /src
parentf332265cdac4ea99ffdeee8e301e8f65c176d330 (diff)
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: https://github.com/nodejs/node/pull/25061#issuecomment-447648475 Fixes: https://github.com/nodejs/node/issues/25134 PR-URL: https://github.com/nodejs/node/pull/25079 Backport-PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src')
-rw-r--r--src/uv.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/uv.cc b/src/uv.cc
index efcb8056124..85f395cc845 100644
--- a/src/uv.cc
+++ b/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