Bug 1244582: Add back in a null check that was accidentally removed. r=smaug
authorKyle Huey <khuey@kylehuey.com>
Mon, 01 Feb 2016 09:44:52 -0800
changeset 282769 45c60b46bab9c109f19325dafd2f6512635903ac
parent 282768 323f89d56ef3741b1f732ad157430b6bb49331f2
child 282770 ff2f25d2c6a846e04d20c073ba609b0e289fc810
push id19510
push usergwagner@mozilla.com
push dateMon, 08 Feb 2016 15:56:48 +0000
treeherderb2g-inbound@a3d54e32dee1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1244582
milestone47.0a1
Bug 1244582: Add back in a null check that was accidentally removed. r=smaug
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2001,16 +2001,17 @@ EventStateManager::GetContentViewer(nsIC
 {
   *aCv = nullptr;
 
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if(!fm) return NS_ERROR_FAILURE;
 
   nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
   fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
+  if (!focusedWindow) return NS_ERROR_FAILURE;
 
   auto* ourWindow = nsPIDOMWindowOuter::From(focusedWindow);
 
   nsCOMPtr<nsPIDOMWindowOuter> rootWindow = ourWindow->GetPrivateRoot();
   if(!rootWindow) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsPIDOMWindowOuter> contentWindow = nsGlobalWindow::Cast(rootWindow)->GetContent();
   if(!contentWindow) return NS_ERROR_FAILURE;