Bug 1395938 - Prevent crash when we are missing an IOThread during shutdown r=michal
MozReview-Commit-ID: 4iuMoHMTzia
--- 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)