Bug 1336802 - Part 1: Fixing the crash of nsILoadInfo::GetOriginAttributes. r=smaug
authorTim Huang <tihuang@mozilla.com>
Tue, 07 Feb 2017 11:49:33 +0800
changeset 341547 9601b50364588fa377038e53659847b80fdc9454
parent 341546 b7ec9bebd877596f5a846005072832db3b0a7e57
child 341548 70debab476881121ddfe92fc60c80cfae0a63bc7
push id37147
push userihsiao@mozilla.com
push dateThu, 09 Feb 2017 04:34:12 +0000
treeherderautoland@70debab47688 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1336802
milestone54.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 1336802 - Part 1: Fixing the crash of nsILoadInfo::GetOriginAttributes. r=smaug
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -7942,18 +7942,20 @@ nsDocShell::EndPageLoad(nsIWebProgress* 
       if (!(mLoadType & LOAD_CMD_HISTORY)) {
         aStatus = NS_ERROR_OFFLINE;
       }
       DisplayLoadError(aStatus, url, nullptr, aChannel);
     }
   } else if (url && NS_SUCCEEDED(aStatus)) {
     // If we have a host
     nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
-    mozilla::net::PredictorLearnRedirect(url, aChannel,
-                                         loadInfo->GetOriginAttributes());
+    if (loadInfo) {
+      mozilla::net::PredictorLearnRedirect(url, aChannel,
+                                           loadInfo->GetOriginAttributes());
+    }
   }
 
   return NS_OK;
 }
 
 //*****************************************************************************
 // nsDocShell: Content Viewer Management
 //*****************************************************************************