Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0da35be commit 4c217e2Copy full SHA for 4c217e2
1 file changed
src/api/dispatcher.cc
@@ -77,9 +77,11 @@ void Dispatcher::OnEvent(int object_id,
77
v8::Integer::New(object_id), v8::String::New(event.c_str()), args };
78
79
// __nwObjectsRegistry.handleEvent(object_id, event, arguments);
80
- v8::Handle<v8::Object> objects_registry =
81
- node::g_context->Global()->Get(v8::String::New("__nwObjectsRegistry"))->
82
- ToObject();
+ v8::Handle<v8::Value> val =
+ node::g_context->Global()->Get(v8::String::New("__nwObjectsRegistry"));
+ if (val->IsNull() || val->IsUndefined())
83
+ return; // need to find out why it's undefined here in debugger
84
+ v8::Handle<v8::Object> objects_registry = val->ToObject();
85
node::MakeCallback(objects_registry, "handleEvent", 3, argv);
86
}
87
0 commit comments