Bug 826195 - Tweak nsPrintObject sanity assertions. r=dholbert
authorCameron McCormack <cam@mcc.id.au>
Sat, 05 Jan 2013 10:24:53 +1100
changeset 126799 9e624b73a293e76000e9119d77e4d7ed07d7a76e
parent 126798 061f752080649e34f54eb143dabb472e0426042b
child 126800 0210c5931bdeea47ff11e7898718c6902e2a01d7
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs826195
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 826195 - Tweak nsPrintObject sanity assertions. r=dholbert
layout/printing/nsPrintData.cpp
--- a/layout/printing/nsPrintData.cpp
+++ b/layout/printing/nsPrintData.cpp
@@ -99,22 +99,22 @@ AssertPresShellsAndContextsSane(nsPrintO
     }
   }
   if (aPO->mPresShell && !aPO->mPresContext) {
     ASSERT_AND_NOTE("print object has pres shell but no pres context");
   }
   if (!aPO->mPresShell && aPO->mPresContext) {
     ASSERT_AND_NOTE("print object has pres context but no pres shell");
   }
-  if (aPO->mPresContext && aPO->mPresContext->GetPresShell() != aPO->mPresShell) {
+  if (aPO->mPresContext &&
+      aPO->mPresShell &&
+      aPO->mPresContext->GetPresShell() &&
+      aPO->mPresContext->GetPresShell() != aPO->mPresShell) {
     ASSERT_AND_NOTE("print object has mismatching pres shell and pres context");
   }
-  if (aPO->mPresContext && !aPO->mPresContext->GetPresShell()) {
-    ASSERT_AND_NOTE("mPresShell->GetPresShell() is null");
-  }
 
   for (uint32_t i = 0; i < aPO->mKids.Length(); i++) {
     AssertPresShellsAndContextsSane(aPO->mKids[i], aPresShells, aPresContexts);
   }
 }
 
 #undef ASSERT_AND_NOTE