We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aca31e3 commit 7546389Copy full SHA for 7546389
src/node_dtrace.cc
@@ -91,8 +91,12 @@ using namespace v8;
91
} \
92
node_dtrace_connection_t conn; \
93
Local<Object> _##conn = Local<Object>::Cast(arg); \
94
- Local<Object> _handle = (_##conn)->Get(String::New("_handle"))->ToObject(); \
95
- SLURP_INT(_handle, fd, &conn.fd); \
+ Local<Value> _handle = (_##conn)->Get(String::New("_handle")); \
+ if (_handle->IsObject()) { \
96
+ SLURP_INT(_handle.As<Object>(), fd, &conn.fd); \
97
+ } else { \
98
+ conn.fd = -1; \
99
+ } \
100
SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
101
SLURP_INT(_##conn, remotePort, &conn.port); \
102
SLURP_INT(_##conn, bufferSize, &conn.buffered);
0 commit comments