Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/V8NodeFilterCondition.cpp ('k') | Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp
diff --git a/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp b/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp
index 0f04f01571af48b5423cf16d3af9889330278199..6baf99c7ec50fc7ff597ba7caec816a700efb68d 100644
--- a/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp
+++ b/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp
@@ -64,12 +64,15 @@ void V8WorkerGlobalScopeEventListener::handleEvent(ScriptState* scriptState, Eve
// Get the V8 wrapper for the event object.
v8::Local<v8::Value> jsEvent = toV8(event, scriptState->context()->Global(), isolate());
+ if (jsEvent.IsEmpty())
+ return;
invokeEventHandler(scriptState, event, v8::Local<v8::Value>::New(isolate(), jsEvent));
}
v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::callListenerFunction(ScriptState* scriptState, v8::Local<v8::Value> jsEvent, Event* event)
{
+ ASSERT(!jsEvent.IsEmpty());
v8::Local<v8::Function> handlerFunction = getListenerFunction(scriptState);
v8::Local<v8::Object> receiver = getReceiverObject(scriptState, event);
if (handlerFunction.IsEmpty() || receiver.IsEmpty())
« no previous file with comments | « Source/bindings/core/v8/V8NodeFilterCondition.cpp ('k') | Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698