summaryrefslogtreecommitdiff
path: root/src/process_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/process_wrap.cc')
-rw-r--r--src/process_wrap.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/process_wrap.cc b/src/process_wrap.cc
index 36c6cfe3ad..2b214d1d47 100644
--- a/src/process_wrap.cc
+++ b/src/process_wrap.cc
@@ -86,6 +86,7 @@ class ProcessWrap : public HandleWrap {
UV_CREATE_PIPE | UV_READABLE_PIPE | UV_WRITABLE_PIPE);
Local<String> handle_key = env->handle_string();
Local<Object> handle = stdio->Get(handle_key).As<Object>();
+ CHECK(!handle.IsEmpty());
options->stdio[i].data.stream =
reinterpret_cast<uv_stream_t*>(
Unwrap<PipeWrap>(handle)->UVHandle());
@@ -109,7 +110,8 @@ class ProcessWrap : public HandleWrap {
static void Spawn(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
- ProcessWrap* wrap = Unwrap<ProcessWrap>(args.Holder());
+ ProcessWrap* wrap;
+ ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
Local<Object> js_options = args[0]->ToObject(env->isolate());
@@ -233,7 +235,8 @@ class ProcessWrap : public HandleWrap {
}
static void Kill(const FunctionCallbackInfo<Value>& args) {
- ProcessWrap* wrap = Unwrap<ProcessWrap>(args.Holder());
+ ProcessWrap* wrap;
+ ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
int signal = args[0]->Int32Value();
int err = uv_process_kill(&wrap->process_, signal);
args.GetReturnValue().Set(err);