Bug 1058650 - updateBrowserSpecificIndicator should not be called for closed tabs, r=Gijs, a=sledru.
authorFlorian Quèze <florian@queze.net>
Wed, 27 Aug 2014 16:52:21 +0200
changeset 216592 27849f3558fada7ed90c70a07c2cbcbc191bc227
parent 216591 9a2da3e4d94445043738e164e51b186f0fab9051
child 216593 3746bf3edf57cd2bbea074584aedc03783540756
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, sledru
bugs1058650
milestone33.0a2
Bug 1058650 - updateBrowserSpecificIndicator should not be called for closed tabs, r=Gijs, a=sledru.
browser/modules/webrtcUI.jsm
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -706,10 +706,13 @@ function removeBrowserNotification(aBrow
   let win = aBrowser.ownerDocument.defaultView;
   let notification =
     win.PopupNotifications.getNotification(aNotificationId, aBrowser);
   if (notification)
     win.PopupNotifications.remove(notification);
 }
 
 function removeBrowserSpecificIndicator(aSubject, aTopic, aData) {
-  updateBrowserSpecificIndicator(getBrowserForWindowId(aData));
+  let browser = getBrowserForWindowId(aData);
+  // If the tab has already been closed, ignore the notification.
+  if (browser.contentWindow)
+    updateBrowserSpecificIndicator(browser);
 }