summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/V8LazyEventListener.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/V8LazyEventListener.cpp')
-rw-r--r--WebCore/bindings/v8/V8LazyEventListener.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/WebCore/bindings/v8/V8LazyEventListener.cpp b/WebCore/bindings/v8/V8LazyEventListener.cpp
index 16b21d6..7f13c5a 100644
--- a/WebCore/bindings/v8/V8LazyEventListener.cpp
+++ b/WebCore/bindings/v8/V8LazyEventListener.cpp
@@ -54,7 +54,11 @@ V8LazyEventListener::V8LazyEventListener(const String& functionName, bool isSVGE
v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(ScriptExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
{
- v8::Local<v8::Function> handlerFunction = v8::Local<v8::Function>::Cast(getListenerObject(context));
+ v8::Local<v8::Object> listenerObject = getListenerObject(context);
+ if (listenerObject.IsEmpty())
+ return v8::Local<v8::Value>();
+
+ v8::Local<v8::Function> handlerFunction = v8::Local<v8::Function>::Cast(listenerObject);
v8::Local<v8::Object> receiver = getReceiverObject(event);
if (handlerFunction.IsEmpty() || receiver.IsEmpty())
return v8::Local<v8::Value>();