Bug 1009688 - Check that Cc["@mozilla.org/wifi/monitor;1"] returns an object before it is used; r=jdm
authorMarcos Caceres <mcaceres@mozilla.com>
Fri, 06 Jun 2014 18:28:56 -0400
changeset 206567 52204412c79b5376d9c6cfa6937cb9a0b8c4d618
parent 206566 c0f0a8689dab95288f5fa5b5048363a99ce576f4
child 206568 abdb3afb720884c936002d664403f4635e3744a1
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1009688
milestone32.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 1009688 - Check that Cc["@mozilla.org/wifi/monitor;1"] returns an object before it is used; r=jdm
dom/system/NetworkGeolocationProvider.js
--- a/dom/system/NetworkGeolocationProvider.js
+++ b/dom/system/NetworkGeolocationProvider.js
@@ -117,17 +117,17 @@ WifiGeoPositionProvider.prototype = {
     try {
       Services.obs.addObserver(this, SETTING_CHANGED_TOPIC, false);
       let settings = Cc["@mozilla.org/settingsService;1"].getService(Ci.nsISettingsService);
       settings.createLock().get(SETTING_DEBUG_ENABLED, settingsCallback);
     } catch(ex) {
       // This platform doesn't have the settings interface, and that is just peachy
     }
 
-    if (gWifiScanningEnabled) {
+    if (gWifiScanningEnabled && Cc["@mozilla.org/wifi/monitor;1"]) {
       this.wifiService = Cc["@mozilla.org/wifi/monitor;1"].getService(Components.interfaces.nsIWifiMonitor);
       this.wifiService.startWatching(this);
     }
     this.timeoutTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     this.timeoutTimer.initWithCallback(this,
                                        gTimeToWaitBeforeSending,
                                        this.timeoutTimer.TYPE_REPEATING_SLACK);
     LOG("startup called.");