Bug 949004 - Check to see if lock is null before using it. r=qDot
authorDave Hylands <dhylands@mozilla.com>
Thu, 07 Nov 2013 16:14:44 -0800
changeset 154137 23cbec7af1fa1d73aff380061c3cd74eaddc16f7
parent 154136 ba4cb364ad6d150a2d70d185eff27ca34d0640f1
child 154138 d6bf7e6d1f2bc93aa946b6b4f2dd4e4cfb9f172b
push id35990
push usercbook@mozilla.com
push dateFri, 08 Nov 2013 14:07:57 +0000
treeherdermozilla-inbound@427ddcc398de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqDot
bugs949004
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 949004 - Check to see if lock is null before using it. r=qDot
dom/system/gonk/AutoMounterSetting.cpp
--- a/dom/system/gonk/AutoMounterSetting.cpp
+++ b/dom/system/gonk/AutoMounterSetting.cpp
@@ -186,17 +186,20 @@ public:
   NS_IMETHOD Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsISettingsService> settingsService =
       do_GetService("@mozilla.org/settingsService;1");
     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;
   }
 
 private:
   int32_t mStatus;
 };
 
 //static