Bug 1320997 - Ignore disconnected iframe nsPIDOMWindowOuters in TabGroup::GetTopLevelWindows, r=smaug
authorMichael Layzell <michael@thelayzells.com>
Tue, 29 Nov 2016 11:50:13 -0500
changeset 324716 23990c75a5e36eb5ecbb551cfcbcb8ae152c764d
parent 324715 334758dabe03d652b633736f71c8544c9c9d19cc
child 324717 7cf56f4e7c0de931e35f56d7220e4b99d0dd3fdf
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssmaug
bugs1320997
milestone53.0a1
Bug 1320997 - Ignore disconnected iframe nsPIDOMWindowOuters in TabGroup::GetTopLevelWindows, r=smaug MozReview-Commit-ID: 8wQSmcS1sUn
dom/base/TabGroup.cpp
--- a/dom/base/TabGroup.cpp
+++ b/dom/base/TabGroup.cpp
@@ -141,17 +141,18 @@ TabGroup::FindItemWithName(const nsAStri
 }
 
 nsTArray<nsPIDOMWindowOuter*>
 TabGroup::GetTopLevelWindows()
 {
   nsTArray<nsPIDOMWindowOuter*> array;
 
   for (nsPIDOMWindowOuter* outerWindow : mWindows) {
-    if (!outerWindow->GetScriptableParentOrNull()) {
+    if (outerWindow->GetDocShell() &&
+        !outerWindow->GetScriptableParentOrNull()) {
       array.AppendElement(outerWindow);
     }
   }
 
   return array;
 }
 
 ThrottledEventQueue*