Bug 1336802 - Part 1: Fixing the crash of nsILoadInfo::GetOriginAttributes. r?smaug draft
authorTim Huang <tihuang@mozilla.com>
Tue, 07 Feb 2017 11:49:33 +0800
changeset 479733 fe9fd318cf2f4e8ef5473a96ed0459992e1badb3
parent 479651 af8a2573d0f1e9cc6f2ba0ab67d7a702a197f177
child 479734 3247541e42737ef4c1302bb303d62dbccebc3324
child 479735 3c0934459587aa7e157e6e4d18d1f8c0560976f5
child 479922 249da8d81c7f94bdec634e3ec0f1f2cc54aca9b3
push id44337
push userbmo:tihuang@mozilla.com
push dateTue, 07 Feb 2017 04:28:14 +0000
reviewerssmaug
bugs1336802
milestone54.0a1
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
 //*****************************************************************************