Bug 927878 - Crash in nsDOMOfflineResourceList::ApplicationCacheAvailable(nsIApplicationCache*) when installing an app. r=jduell, a=lsblakk
authorHonza Bambas <honzab.moz@firemni.cz>
Wed, 06 Nov 2013 16:59:04 +0100
changeset 167389 9ac9f5a95f24237b6cf89e9be98753b57a09d939
parent 167388 1b79c0dce40df04a683585e4836bb96205bad61f
child 167390 571b5e7bf31ff16b41be84ce5116c99a249ca32d
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell, lsblakk
bugs927878
milestone27.0a2
Bug 927878 - Crash in nsDOMOfflineResourceList::ApplicationCacheAvailable(nsIApplicationCache*) when installing an app. r=jduell, a=lsblakk
uriloader/prefetch/nsOfflineCacheUpdate.cpp
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -2000,16 +2000,22 @@ nsOfflineCacheUpdate::NotifyUpdateAvaila
     nsCOMPtr<nsIObserver> observer;
     observer.swap(mUpdateAvailableObserver);
     observer->Observe(mManifestURI, topic, nullptr);
 }
 
 void
 nsOfflineCacheUpdate::AssociateDocuments(nsIApplicationCache* cache)
 {
+    if (!cache) {
+        LOG(("nsOfflineCacheUpdate::AssociateDocuments bypassed"
+             ", no cache provided [this=%p]", this));
+        return;
+    }
+
     nsCOMArray<nsIOfflineCacheUpdateObserver> observers;
     GatherObservers(observers);
 
     for (int32_t i = 0; i < observers.Count(); i++) {
         observers[i]->ApplicationCacheAvailable(cache);
     }
 }