Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3d5136

Browse files
committed
check window script context in will handle navigation callback
1 parent 39e0731 commit d3d5136

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/api/dispatcher.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ void Dispatcher::willHandleNavigationPolicy(
215215

216216
v8::Isolate* isolate = v8::Isolate::GetCurrent();
217217

218-
v8::Handle<v8::Value> id_val = nwapi::Dispatcher::GetWindowId(web_view->mainFrame());
218+
v8::Handle<v8::Value> id_val;
219+
if (web_view->mainFrame() && !web_view->mainFrame()->mainWorldScriptContext().IsEmpty())
220+
id_val = nwapi::Dispatcher::GetWindowId(web_view->mainFrame());
219221
if (id_val.IsEmpty())
220222
return;
221223
if (id_val->IsUndefined() || id_val->IsNull())

0 commit comments

Comments
 (0)