Bug 701299 - crash nsGlobalWindow::LeaveModalState, r=smaug,khuey
authorandrew.quartey@gmail.com
Wed, 05 Sep 2012 21:25:53 +0300
changeset 106303 bcc2d5b5b351664686b166763ba9d40c3c82e8f1
parent 106302 eb201b1e55fd10dd47a1804bfe33d7cc976708a7
child 106304 647fabcaa95110160bf8af95d0b347e0bb1af3f6
push id58
push usershu@rfrn.org
push dateFri, 07 Sep 2012 18:20:16 +0000
reviewerssmaug, khuey
bugs701299
milestone18.0a1
Bug 701299 - crash nsGlobalWindow::LeaveModalState, r=smaug,khuey
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6800,19 +6800,21 @@ nsGlobalWindow::LeaveModalState(nsIDOMWi
         do_QueryInterface(topWin->GetExtantDocument());
       mSuspendedDoc->UnsuppressEventHandlingAndFireEvents(currentDoc == mSuspendedDoc);
       mSuspendedDoc = nullptr;
     }
   }
 
   if (aCallerWin) {
     nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(aCallerWin));
-    nsIScriptContext *scx = sgo->GetContext();
-    if (scx)
-      scx->LeaveModalState();
+    if (sgo) {
+      nsIScriptContext *scx = sgo->GetContext();
+      if (scx)
+        scx->LeaveModalState();
+    }
   }
 
   if (mContext) {
     mContext->LeaveModalState();
   }
 
   // Remember the time of the last dialog quit.
   nsGlobalWindow *inner = topWin->GetCurrentInnerWindowInternal();