Bug 1244076 - Fix a crash in nsDocShell::IssueWarning by null-checking mContentViewer; r=bzbarsky, a=sylvestre
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Feb 2016 10:24:32 -0500
changeset 311114 458a80d87ead5dfec49e6f4b1589e9a553c8aaf6
parent 311113 2cb72f2115e72d3a431056ae33fab28fc098bb3a
child 311115 d6f5a4905c66b5c97582ad11e4705f142838e7b7
push id5563
push usercbook@mozilla.com
push dateThu, 04 Feb 2016 14:06:48 +0000
treeherdermozilla-beta@688a42663f99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky, sylvestre
bugs1244076
milestone45.0
Bug 1244076 - Fix a crash in nsDocShell::IssueWarning by null-checking mContentViewer; r=bzbarsky, a=sylvestre
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -14238,14 +14238,16 @@ nsDocShell::InFrameSwap()
     shell = shell->GetParentDocshell();
   } while (shell);
   return false;
 }
 
 NS_IMETHODIMP
 nsDocShell::IssueWarning(uint32_t aWarning, bool aAsError)
 {
-  nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
-  if (doc) {
-    doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError);
-  }
-  return NS_OK;
-}
+  if (mContentViewer) {
+    nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
+    if (doc) {
+      doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError);
+    }
+  }
+  return NS_OK;
+}