Bug 1478081 - avoid accessing null pointer; r=valentin
authorLiang-Heng Chen <xeonchen@gmail.com>
Tue, 24 Jul 2018 21:03:03 +0000
changeset 428055 0b9c0b211eb3d84c5afdb64f4a91d079d0aa4c75
parent 428054 e56525462fdbf43851d9e7df487babbfbaa18222
child 428056 2062a23f0e5a52cfe93ca4abef4da455cadf742a
child 428312 64ff37be9d0ec0bc9379e058b72c2a48390f8d7a
push id34325
push usertoros@mozilla.com
push dateWed, 25 Jul 2018 10:05:35 +0000
treeherdermozilla-central@0b9c0b211eb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1478081
milestone63.0a1
first release with
nightly linux32
0b9c0b211eb3 / 63.0a1 / 20180725103029 / files
nightly linux64
0b9c0b211eb3 / 63.0a1 / 20180725103029 / files
nightly mac
0b9c0b211eb3 / 63.0a1 / 20180725103029 / files
nightly win32
0b9c0b211eb3 / 63.0a1 / 20180725103029 / files
nightly win64
0b9c0b211eb3 / 63.0a1 / 20180725103029 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1478081 - avoid accessing null pointer; r=valentin Differential Revision: https://phabricator.services.mozilla.com/D2336
netwerk/protocol/http/HttpChannelChild.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -2691,18 +2691,20 @@ HttpChannelChild::ContinueAsyncOpen()
   // which changes on every new load or navigation.
   uint64_t contentWindowId = 0;
   TimeStamp navigationStartTimeStamp;
   if (tabChild) {
     MOZ_ASSERT(tabChild->WebNavigation());
     nsCOMPtr<nsIDocument> document = tabChild->GetDocument();
     if (document) {
       contentWindowId = document->InnerWindowID();
-      navigationStartTimeStamp =
-        document->GetNavigationTiming()->GetNavigationStartTimeStamp();
+      nsDOMNavigationTiming* navigationTiming = document->GetNavigationTiming();
+      if (navigationTiming) {
+        navigationStartTimeStamp = navigationTiming->GetNavigationStartTimeStamp();
+      }
       mTopLevelOuterContentWindowId = document->OuterWindowID();
     }
   }
   SetTopLevelContentWindowId(contentWindowId);
 
   HttpChannelOpenArgs openArgs;
   // No access to HttpChannelOpenArgs members, but they each have a
   // function with the struct name that returns a ref.