Bug 746548 - Fix NPE for cache service in pause/resume. r=mfinkle a=blocking-fennec

This commit is contained in:
Brian Nicholson
2012-04-18 13:08:36 -07:00
parent e38e8e4eaa
commit b0a48c8a4a

View File

@@ -335,7 +335,8 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
// If we are OOM killed with the disk cache enabled, the entire
// cache will be cleared (bug 105843), so shut down the cache here
// and re-init on resume
nsCacheService::GlobalInstance()->Shutdown();
if (nsCacheService::GlobalInstance())
nsCacheService::GlobalInstance()->Shutdown();
}
// We really want to send a notification like profile-before-change,
@@ -467,7 +468,8 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
// If we are OOM killed with the disk cache enabled, the entire
// cache will be cleared (bug 105843), so shut down cache on pause
// and re-init here
nsCacheService::GlobalInstance()->Init();
if (nsCacheService::GlobalInstance())
nsCacheService::GlobalInstance()->Init();
// We didn't return from one of our own activities, so restore
// to foreground status