Bug 684135 - Protect against calling this function during shutdown. r=bzbarsky
authorBlake Kaplan <mrbkap@gmail.com>
Fri, 02 Sep 2011 16:49:08 -0700
changeset 76495 d06e88a99f39a02d5b0d3594df879fea846de2b1
parent 76494 9d79f12f8d33f96936d647be083e9c292ea3d90a
child 76496 3a37edcaa27fb9b3699f791414c44f9a500a5ced
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbzbarsky
bugs684135
milestone9.0a1
Bug 684135 - Protect against calling this function during shutdown. r=bzbarsky
dom/base/nsGlobalWindow.h
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -537,16 +537,20 @@ public:
   }
 
   static nsGlobalWindow* GetOuterWindowWithId(PRUint64 aWindowID) {
     nsGlobalWindow* outerWindow = sWindowsById->Get(aWindowID);
     return outerWindow && !outerWindow->IsInnerWindow() ? outerWindow : nsnull;
   }
 
   static nsGlobalWindow* GetInnerWindowWithId(PRUint64 aInnerWindowID) {
+    if (!sWindowsById) {
+      return nsnull;
+    }
+
     nsGlobalWindow* innerWindow = sWindowsById->Get(aInnerWindowID);
     return innerWindow && innerWindow->IsInnerWindow() ? innerWindow : nsnull;
   }
 
   static bool HasIndexedDBSupport();
 
   static bool HasPerformanceSupport();