Bug 1229195: ignore messages when content is null. r=Standard8
authorMike de Boer <mdeboer@mozilla.com>
Thu, 18 Feb 2016 13:02:33 +0100
changeset 285301 d785fddce4c1c3c0f45e31acba243037292324eb
parent 285300 cab091009e2898126c1bd24bc7fed13831894bf2
child 285302 1b9d91965921cc7d3f7c9d6684315bc7ace03a17
push id17783
push usermdeboer@mozilla.com
push dateWed, 24 Feb 2016 12:32:05 +0000
treeherderfx-team@d785fddce4c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1229195
milestone47.0a1
Bug 1229195: ignore messages when content is null. r=Standard8
browser/base/content/social-content.js
--- a/browser/base/content/social-content.js
+++ b/browser/base/content/social-content.js
@@ -59,16 +59,21 @@ SocialErrorListener = {
     addMessageListener("WaitForDOMContentLoaded", this);
     let webProgress = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                               .getInterface(Components.interfaces.nsIWebProgress);
     webProgress.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_STATE_REQUEST |
                                           Ci.nsIWebProgress.NOTIFY_LOCATION);
   },
 
   receiveMessage(message) {
+    if (!content) {
+      Cu.reportError("Message received whilst `content` is null: " + message.name);
+      return;
+    }
+
     let document = content.document;
 
     switch (message.name) {
       case "Loop:GetAllWebrtcStats":
         content.WebrtcGlobalInformation.getAllStats(allStats => {
           content.WebrtcGlobalInformation.getLogging("", logs => {
             sendAsyncMessage("Loop:GetAllWebrtcStats", {
               allStats: allStats,