diff --git a/dom/wifi/WifiWorker.js b/dom/wifi/WifiWorker.js index a4cba2f8aee4..a49ac679e3b3 100644 --- a/dom/wifi/WifiWorker.js +++ b/dom/wifi/WifiWorker.js @@ -2778,6 +2778,11 @@ WifiWorker.prototype = { var timer = null; var self = this; + if (!WifiManager.enabled) { + callback.onfailure(); + return; + } + self.waitForScan(waitForScanCallback); doScan(); function doScan() {