Bug 1395938 - Prevent crash when we are missing an IOThread during shutdown r=michal
authorValentin Gosu <valentin.gosu@gmail.com>
Thu, 07 Sep 2017 15:15:25 +0200
changeset 379554 d6e1c5f5a5c3
parent 379553 8b1881ead0b6
child 379555 665ea291fce4
push id32456
push userarchaeopteryx@coole-files.de
push dateThu, 07 Sep 2017 22:00:40 +0000
treeherdermozilla-central@b4c1ad9565ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1395938
milestone57.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 1395938 - Prevent crash when we are missing an IOThread during shutdown r=michal MozReview-Commit-ID: 4iuMoHMTzia
netwerk/cache2/CacheStorageService.cpp
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -2030,17 +2030,20 @@ CacheStorageService::GetCacheEntryInfo(C
                          fetchCount, lastModified, expirationTime,
                          aEntry->IsPinned(), info);
 }
 
 // static
 uint32_t CacheStorageService::CacheQueueSize(bool highPriority)
 {
   RefPtr<CacheIOThread> thread = CacheFileIOManager::IOThread();
-  MOZ_ASSERT(thread);
+  // The thread will be null at shutdown.
+  if (!thread) {
+    return 0;
+  }
   return thread->QueueSize(highPriority);
 }
 
 // Telemetry collection
 
 namespace {
 
 bool TelemetryEntryKey(CacheEntry const* entry, nsAutoCString& key)