Bug 949004 - Check to see if lock is null before using it. r=qDot

--HG--
extra : rebase_source : 115a50601853376ae1a0548aad4d61f58e96c8d1
This commit is contained in:
Dave Hylands 2013-11-07 16:14:44 -08:00
Родитель 9a299e00ab
Коммит 22cb4e6756
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -191,7 +191,10 @@ public:
NS_ENSURE_TRUE(settingsService, NS_ERROR_FAILURE);
nsCOMPtr<nsISettingsServiceLock> lock;
settingsService->CreateLock(getter_AddRefs(lock));
lock->Set(UMS_STATUS, INT_TO_JSVAL(mStatus), nullptr, nullptr);
// lock may be null if this gets called during shutdown.
if (lock) {
lock->Set(UMS_STATUS, INT_TO_JSVAL(mStatus), nullptr, nullptr);
}
return NS_OK;
}