Bug 1315796 Don't deref nullptr docshell in TabGroupOuter() validation code. r=smaug
authorBen Kelly <ben@wanderview.com>
Mon, 07 Nov 2016 14:22:12 -0800
changeset 348273 fc00f40f2b6ed681952171c5901cc376b64cbb72
parent 348272 39aebea1fbb85c40d098208e742021e23c95375b
child 348274 6a7831fbca696651b68f30cbe0d984d2fc1357c3
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1315796
milestone52.0a1
Bug 1315796 Don't deref nullptr docshell in TabGroupOuter() validation code. r=smaug
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -14806,17 +14806,17 @@ nsGlobalWindow::TabGroupOuter()
   }
   MOZ_ASSERT(mTabGroup);
 
 #ifdef DEBUG
   // Ensure that we don't recurse forever
   if (!mIsValidatingTabGroup) {
     mIsValidatingTabGroup = true;
     // We only need to do this check if we aren't in the chrome tab group
-    if (GetDocShell()->ItemType() == nsIDocShellTreeItem::typeChrome) {
+    if (mIsChrome) {
       MOZ_ASSERT(mTabGroup == TabGroup::GetChromeTabGroup());
     } else {
       // Sanity check that our tabgroup matches our opener or parent.
       RefPtr<nsPIDOMWindowOuter> parent = GetScriptableParentOrNull();
       MOZ_ASSERT_IF(parent, parent->TabGroup() == mTabGroup);
       nsCOMPtr<nsPIDOMWindowOuter> piOpener = do_QueryReferent(mOpener);
       nsPIDOMWindowOuter* opener = GetSanitizedOpener(piOpener);
       MOZ_ASSERT_IF(opener && Cast(opener) != this, opener->TabGroup() == mTabGroup);