Bug 688895 - Add null check for widget in nsXULPopupManager::ShowTooltipAtScreen r=tnikkel a=lsblakk
authorAndrew Quartey <andrew.quartey@gmail.com>
Wed, 05 Sep 2012 21:36:15 -0400
changeset 110233 73df03c49a38c5dfc081e004ed697d4f34debe84
parent 110232 4d4f679506c118f5be70bcf7b256c89734c92558
child 110234 0677438ae4ce7df068bc54406438510ff75a3771
push id214
push userakeybl@mozilla.com
push dateWed, 14 Nov 2012 20:38:59 +0000
treeherdermozilla-release@c8b08ec8e1aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, lsblakk
bugs688895
milestone17.0
Bug 688895 - Add null check for widget in nsXULPopupManager::ShowTooltipAtScreen r=tnikkel a=lsblakk
layout/xul/base/src/nsXULPopupManager.cpp
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -599,17 +599,18 @@ nsXULPopupManager::ShowTooltipAtScreen(n
   mCachedMousePoint = nsIntPoint(aXPos, aYPos);
   // coordinates are relative to the root widget
   nsPresContext* rootPresContext =
     popupFrame->PresContext()->GetRootPresContext();
   if (rootPresContext) {
     nsCOMPtr<nsIWidget> widget;
     rootPresContext->PresShell()->GetViewManager()->
       GetRootWidget(getter_AddRefs(widget));
-    mCachedMousePoint -= widget->WidgetToScreenOffset();
+    if (widget)
+      mCachedMousePoint -= widget->WidgetToScreenOffset();
   }
 
   popupFrame->InitializePopupAtScreen(aTriggerContent, aXPos, aYPos, false);
 
   FirePopupShowingEvent(aPopup, false, false);
 }
 
 void