Bug 426392 - Crash in nsXULPopupManager::ShowPopupCallback when customizing toolbar on OS X, patch by Chris Pearce (chris@pearce.org.nz), r+sr=roc, a=blocker
authorphilringnalda@gmail.com
Thu, 03 Apr 2008 20:29:17 -0700
changeset 13884 85ddf6c0d23ffe512c45522f484f6aa6d436a94c
parent 13883 52390d45c68b4443dc42c262dbb12a039fd43a24
child 13885 391ff2bf0485ef2fa0d26249c5dbb592469de867
push idunknown
push userunknown
push dateunknown
reviewersblocker
bugs426392
milestone1.9pre
Bug 426392 - Crash in nsXULPopupManager::ShowPopupCallback when customizing toolbar on OS X, patch by Chris Pearce (chris@pearce.org.nz), r+sr=roc, a=blocker
layout/xul/base/src/nsXULPopupManager.cpp
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -518,19 +518,23 @@ CheckCaretDrawingState(nsIDocument *aDoc
   nsCOMPtr<nsIDOMDocument> domDoc;
   nsCOMPtr<nsIDocument> focusedDoc;
   windowInternal->GetDocument(getter_AddRefs(domDoc));
   focusedDoc = do_QueryInterface(domDoc);
   if (!focusedDoc)
     return;
 
   nsIPresShell* presShell = focusedDoc->GetPrimaryShell();
+  if (!presShell)
+    return;
 
   nsCOMPtr<nsICaret> caret;
   nsresult res = presShell->GetCaret(getter_AddRefs(caret));
+  if (!caret)
+    return;
   caret->CheckCaretDrawingState();
 
 }
 
 void
 nsXULPopupManager::ShowPopupCallback(nsIContent* aPopup,
                                      nsMenuPopupFrame* aPopupFrame,
                                      PRBool aIsContextMenu,