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
parent d9057b1d15
commit ad9af99987

View File

@ -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;
}