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 321580 fc00f40f2b6ed681952171c5901cc376b64cbb72
parent 321579 39aebea1fbb85c40d098208e742021e23c95375b
child 321581 6a7831fbca696651b68f30cbe0d984d2fc1357c3
push id30931
push userkwierso@gmail.com
push dateTue, 08 Nov 2016 21:58:36 +0000
treeherdermozilla-central@783356f1476e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1315796
milestone52.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 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);