Bug 1382093 - Null check docShell in InternalSetDocShellIsActive, r=smaug
authorMichael Layzell <michael@thelayzells.com>
Tue, 25 Jul 2017 11:35:39 -0400
changeset 419600 508e4725fa734d2e00dc702571369ba33214cd20
parent 419599 bb9485e6290b847bc60d371e8624229960b44b48
child 419601 2af86a1d1f7a540d8bfab23544373adbc86d9cde
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1382093
milestone56.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 1382093 - Null check docShell in InternalSetDocShellIsActive, r=smaug MozReview-Commit-ID: JHtmTSomFlb
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2457,16 +2457,20 @@ TabChild::InternalSetDocShellIsActive(bo
     }
 
     docShell->SetIsActive(aIsActive);
   }
 
   if (aIsActive) {
     MakeVisible();
 
+    if (!docShell) {
+      return;
+    }
+
     // We don't use TabChildBase::GetPresShell() here because that would create
     // a content viewer if one doesn't exist yet. Creating a content viewer can
     // cause JS to run, which we want to avoid. nsIDocShell::GetPresShell
     // returns null if no content viewer exists yet.
     if (nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell()) {
       if (nsIFrame* root = presShell->FrameConstructor()->GetRootFrame()) {
         FrameLayerBuilder::InvalidateAllLayersForFrame(
           nsLayoutUtils::GetDisplayRootFrame(root));