Chromium Code Reviews| Index: Source/bindings/core/v8/ScriptController.cpp |
| diff --git a/Source/bindings/core/v8/ScriptController.cpp b/Source/bindings/core/v8/ScriptController.cpp |
| index dac562197a9427ea5059f6d46710f4a2b87a0028..bc90fc40411315284c253f49b20c3517dd7139be 100644 |
| --- a/Source/bindings/core/v8/ScriptController.cpp |
| +++ b/Source/bindings/core/v8/ScriptController.cpp |
| @@ -353,6 +353,8 @@ static NPObject* createScriptObject(LocalFrame* frame, v8::Isolate* isolate) |
| ScriptState::Scope scope(scriptState); |
| LocalDOMWindow* window = frame->localDOMWindow(); |
| v8::Local<v8::Value> global = toV8(window, scriptState->context()->Global(), scriptState->isolate()); |
| + if (global.IsEmpty()) |
| + return createNoScriptObject(); |
| ASSERT(global->IsObject()); |
| return npCreateV8ScriptObject(isolate, 0, v8::Local<v8::Object>::Cast(global), window); |
| } |
| @@ -389,7 +391,7 @@ NPObject* ScriptController::createScriptObjectForPluginElement(HTMLPlugInElement |
| ScriptState::Scope scope(scriptState); |
| LocalDOMWindow* window = frame()->localDOMWindow(); |
| v8::Local<v8::Value> v8plugin = toV8(plugin, scriptState->context()->Global(), scriptState->isolate()); |
| - if (!v8plugin->IsObject()) |
| + if (v8plugin.IsEmpty() || !v8plugin->IsObject()) |
|
haraken
2015/04/28 04:24:59
I think we can remove the v8plugin->IsObject() che
Yuki
2015/04/28 04:47:57
For the code reader, it's not clear that the follo
bashi
2015/04/28 05:41:53
I'd also prefer keeping IsObject() check. Let's ke
|
| return createNoScriptObject(); |
| return npCreateV8ScriptObject(scriptState->isolate(), 0, v8::Local<v8::Object>::Cast(v8plugin), window); |