OSDN Git Service

Pick up a bug fix from Chromium.
authorFeng Qian <fqian@google.com>
Tue, 14 Jul 2009 20:20:05 +0000 (13:20 -0700)
committerFeng Qian <fqian@google.com>
Tue, 14 Jul 2009 20:20:05 +0000 (13:20 -0700)
The same fix is upstreamed to WebKit.

WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp

index b0789e5..2ed1638 100644 (file)
@@ -79,8 +79,10 @@ ACCESSOR_GETTER(DOMApplicationCacheEventHandler)
 {
     INC_STATS("DOMApplicationCache.onevent_getter");
     DOMApplicationCache* appcache = V8Proxy::ToNativeObject<DOMApplicationCache>(V8ClassIndex::DOMAPPLICATIONCACHE, info.Holder());
-    EventListener* listener = appcache->getAttributeEventListener(toEventType(name));
-    return eventListenerToV8Object(listener);
+    if (EventListener* listener = appcache->getAttributeEventListener(toEventType(name))) {
+      return eventListenerToV8Object(listener);
+    }
+    return v8::Null();
 }
 
 // Handles appcache.onfooevent attribute setting