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 154080 23cbec7af1fa1d73aff380061c3cd74eaddc16f7
parent 154079 ba4cb364ad6d150a2d70d185eff27ca34d0640f1
child 154081 d6bf7e6d1f2bc93aa946b6b4f2dd4e4cfb9f172b
push id2233
push userdhylands@mozilla.com
push dateFri, 08 Nov 2013 05:33:16 +0000
treeherderb2g-inbound@23cbec7af1fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqDot
bugs949004
milestone28.0a1
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