diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc index 49ebf07cf82..5c01a1753ce 100644 --- a/src/node_dtrace.cc +++ b/src/node_dtrace.cc @@ -91,8 +91,12 @@ using namespace v8; } \ node_dtrace_connection_t conn; \ Local _##conn = Local::Cast(arg); \ - Local _handle = (_##conn)->Get(String::New("_handle"))->ToObject(); \ - SLURP_INT(_handle, fd, &conn.fd); \ + Local _handle = (_##conn)->Get(String::New("_handle")); \ + if (_handle->IsObject()) { \ + SLURP_INT(_handle.As(), fd, &conn.fd); \ + } else { \ + conn.fd = -1; \ + } \ SLURP_STRING(_##conn, remoteAddress, &conn.remote); \ SLURP_INT(_##conn, remotePort, &conn.port); \ SLURP_INT(_##conn, bufferSize, &conn.buffered);