Index: third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp |
index 24e1cdf10105ae3604bb0f05620784c4f51da439..3f0c2b2099113123c4bf7f9ac4ebadcd51b489e0 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp |
@@ -228,6 +228,9 @@ static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Local<v8::Obj |
v8::Local<v8::Value> PrivateScriptRunner::installClassIfNeeded(Document* document, String className) |
{ |
+ if (!document->contextDocument()->frame()) |
+ return v8::Local<v8::Value>(); |
+ |
v8::HandleScope handleScope(toIsolate(document)); |
ScriptState* scriptState = ScriptState::forWorld(document->contextDocument()->frame(), DOMWrapperWorld::privateScriptIsolatedWorld()); |
if (!scriptState->contextIsValid()) |