summaryrefslogtreecommitdiff
path: root/src/uv.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-12-17 02:22:35 +0100
committerAnna Henningsen <anna@addaleax.net>2018-12-19 17:31:06 +0100
commit67f95825e5ad3f80d007613df8b21f4f2819c635 (patch)
tree574406857ea3e4fffd68ade29a598c1ce4b165b4 /src/uv.cc
parenta76750b49e70fbf32711d68608db3e320f19b359 (diff)
downloadandroid-node-v8-67f95825e5ad3f80d007613df8b21f4f2819c635.tar.gz
android-node-v8-67f95825e5ad3f80d007613df8b21f4f2819c635.tar.bz2
android-node-v8-67f95825e5ad3f80d007613df8b21f4f2819c635.zip
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 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/uv.cc')
-rw-r--r--src/uv.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/uv.cc b/src/uv.cc
index 79c221f4df..27daed556e 100644
--- a/src/uv.cc
+++ b/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