Bug 978001. Null check presshell in nsViewManager::ProcessPendingUpdatesForView. r=mats
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 02 Mar 2014 05:14:27 -0600
changeset 171734 5b678e143116d162aff13659da3257068fce1db4
parent 171733 984bd72d320c6a2611cbaae20b05824d51814e84
child 171735 2cab8c44a9b976f6f11ead9e843ead2bbaf2f3a4
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmats
bugs978001
milestone30.0a1
Bug 978001. Null check presshell in nsViewManager::ProcessPendingUpdatesForView. r=mats
view/src/nsViewManager.cpp
--- a/view/src/nsViewManager.cpp
+++ b/view/src/nsViewManager.cpp
@@ -406,32 +406,34 @@ void nsViewManager::ProcessPendingUpdate
         if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
             vm->mRootView->IsEffectivelyVisible() &&
             vm->mPresShell && vm->mPresShell->IsVisible()) {
           vm->FlushDelayedResize(true);
         }
       }
       NS_ASSERTION(aView->HasWidget(), "FlushDelayedResize removed our widget!");
 
+      if (presShell) {
 #ifdef MOZ_DUMP_PAINTING
-      if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
-        printf_stderr("---- PAINT START ----PresShell(%p), nsView(%p), nsIWidget(%p)\n", presShell, aView, widget);
-      }
+        if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
+          printf_stderr("---- PAINT START ----PresShell(%p), nsView(%p), nsIWidget(%p)\n", presShell, aView, widget);
+        }
 #endif
-      nsAutoScriptBlocker scriptBlocker;
-      SetPainting(true);
-      presShell->Paint(aView, nsRegion(), nsIPresShell::PAINT_LAYERS);
+        nsAutoScriptBlocker scriptBlocker;
+        SetPainting(true);
+        presShell->Paint(aView, nsRegion(), nsIPresShell::PAINT_LAYERS);
 #ifdef MOZ_DUMP_PAINTING
-      if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
-        printf_stderr("---- PAINT END ----\n");
-      }
+        if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
+          printf_stderr("---- PAINT END ----\n");
+        }
 #endif
 
-      aView->SetForcedRepaint(false);
-      SetPainting(false);
+        aView->SetForcedRepaint(false);
+        SetPainting(false);
+      }
       viewManager->FlushDirtyRegionToWidget(aView);
     } else {
       viewManager->FlushDirtyRegionToWidget(aView);
     }
   }
 }
 
 void nsViewManager::FlushDirtyRegionToWidget(nsView* aView)