diff --git a/src/node_worker.cc b/src/node_worker.cc index bdf324fa047624..2976302bb4b9b7 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -459,13 +459,15 @@ void Worker::New(const FunctionCallbackInfo& args) { // The first argument is program name. invalid_args.erase(invalid_args.begin()); if (errors.size() > 0 || invalid_args.size() > 0) { - v8::Local error = - ToV8Value(env->context(), - errors.size() > 0 ? errors : invalid_args) - .ToLocalChecked(); + v8::Local error; + if (!ToV8Value(env->context(), + errors.size() > 0 ? errors : invalid_args) + .ToLocal(&error)) { + return; + } Local key = FIXED_ONE_BYTE_STRING(env->isolate(), "invalidExecArgv"); - USE(args.This()->Set(env->context(), key, error).FromJust()); + USE(args.This()->Set(env->context(), key, error)); return; } }