Bug 683945 - Avoid using a deleted hashtable for finding window IDs. r=jst
authorJosh Matthews <josh@joshmatthews.net>
Sat, 03 Sep 2011 19:43:22 -0400
changeset 76608 41d43c3a7286b6d93ac60224e753d7a94912ba36
parent 76607 293f78abf3e7e0eb95194a3471e0b2d9129ce2ce
child 76609 a38f82d29d97475d6227285b93af80eafeed32a4
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjst
bugs683945
milestone9.0a1
Bug 683945 - Avoid using a deleted hashtable for finding window IDs. r=jst
dom/base/nsGlobalWindow.h
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -532,16 +532,20 @@ public:
                                     const nsAString &aPopupWindowName,
                                     const nsAString &aPopupWindowFeatures);
 
   virtual PRUint32 GetSerial() {
     return mSerial;
   }
 
   static nsGlobalWindow* GetOuterWindowWithId(PRUint64 aWindowID) {
+    if (!sWindowsById) {
+      return nsnull;
+    }
+
     nsGlobalWindow* outerWindow = sWindowsById->Get(aWindowID);
     return outerWindow && !outerWindow->IsInnerWindow() ? outerWindow : nsnull;
   }
 
   static nsGlobalWindow* GetInnerWindowWithId(PRUint64 aInnerWindowID) {
     if (!sWindowsById) {
       return nsnull;
     }