Bug 801723. WebIDL binding objects may not have classinfo even if they're nsISupports. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 22 Oct 2012 13:08:51 -0400
changeset 111172 95be4274988ce54067798bee82efdae7b2a98f28
parent 111171 8101371a2a4e9be8e2ced881f5d997cee176bc3c
child 111173 480088c6114cf1e3eedc17b525061d74a080f0db
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewerspeterv
bugs801723
milestone19.0a1
Bug 801723. WebIDL binding objects may not have classinfo even if they're nsISupports. r=peterv
js/xpconnect/src/XPCJSID.cpp
--- a/js/xpconnect/src/XPCJSID.cpp
+++ b/js/xpconnect/src/XPCJSID.cpp
@@ -479,16 +479,20 @@ nsJSIID::HasInstance(nsIXPConnectWrapped
 #endif
             if (!MorphSlimWrapper(cx, obj))
                 return NS_ERROR_FAILURE;
         }
 
         nsISupports *identity;
         if (mozilla::dom::UnwrapDOMObjectToISupports(obj, identity)) {
             nsCOMPtr<nsIClassInfo> ci = do_QueryInterface(identity);
+            if (!ci) {
+                // No classinfo means we're not implementing interfaces and all
+                return NS_OK;
+            }
 
             XPCCallContext ccx(JS_CALLER, cx);
 
             AutoMarkingNativeSetPtr set(ccx);
             set = XPCNativeSet::GetNewOrUsed(ccx, ci);
             if (!set)
                 return NS_ERROR_FAILURE;
             *bp = set->HasInterfaceWithAncestor(iid);