Bug 1162787 - Check for null before calling Equals. r=ehsan
authorNikhil Marathe <nsm.nikhil@gmail.com>
Thu, 07 May 2015 19:10:06 -0700
changeset 274285 6a92a651603a422437925421e319cef429ee7c71
parent 274284 a455c8bce215d3b9361c55ee68c9d36e6f4c2379
child 274286 2623b743e4c33f6897a70340fdf697e76fae5264
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1162787
milestone40.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 1162787 - Check for null before calling Equals. r=ehsan CLOSED TREE
dom/workers/ServiceWorkerPeriodicUpdater.cpp
--- a/dom/workers/ServiceWorkerPeriodicUpdater.cpp
+++ b/dom/workers/ServiceWorkerPeriodicUpdater.cpp
@@ -55,17 +55,17 @@ ServiceWorkerPeriodicUpdater::Observe(ns
                                       const char16_t* aData)
 {
   // In tests, the pref is set to false so that the idle-daily service does not
   // trigger updates leading to intermittent failures.
   // We're called from SpecialPowers inside tests, in which case we need to
   // update during the test run, for which we use a non-empty aData.
   NS_NAMED_LITERAL_STRING(CallerSpecialPowers, "Caller:SpecialPowers");
   if (strcmp(aTopic, OBSERVER_TOPIC_IDLE_DAILY) == 0 &&
-      (sPeriodicUpdatesEnabled || CallerSpecialPowers.Equals(aData))) {
+      (sPeriodicUpdatesEnabled || (aData && CallerSpecialPowers.Equals(aData)))) {
     // First, update all registrations in the parent process.
     nsCOMPtr<nsIServiceWorkerManager> swm =
       mozilla::services::GetServiceWorkerManager();
     if (swm) {
         swm->UpdateAllRegistrations();
     }
 
     // Now, tell all child processes to update their registrations as well.