Bug 1278452 - Fix some null checks in dom/xbl/. r=mrbkap.

--HG--
extra : rebase_source : 2ffe1b24834ee863705b36085da44cefe331f951
This commit is contained in:
Nicholas Nethercote 2016-06-07 15:24:48 +10:00
parent ba949d4617
commit 3c7909e181

View File

@ -541,9 +541,11 @@ nsXBLService::AttachGlobalKeyHandler(EventTarget* aTarget)
piTarget = doc; // We're a XUL keyset. Attach to our document.
}
EventListenerManager* manager = piTarget->GetOrCreateListenerManager();
if (!piTarget)
return NS_ERROR_FAILURE;
if (!piTarget || !manager)
EventListenerManager* manager = piTarget->GetOrCreateListenerManager();
if (!manager)
return NS_ERROR_FAILURE;
// the listener already exists, so skip this
@ -586,9 +588,11 @@ nsXBLService::DetachGlobalKeyHandler(EventTarget* aTarget)
if (doc)
piTarget = do_QueryInterface(doc);
EventListenerManager* manager = piTarget->GetOrCreateListenerManager();
if (!piTarget)
return NS_ERROR_FAILURE;
if (!piTarget || !manager)
EventListenerManager* manager = piTarget->GetOrCreateListenerManager();
if (!manager)
return NS_ERROR_FAILURE;
nsIDOMEventListener* handler =