Bug 976455 - Check p2pSupported and p2pManager in WifiWorker.js::syncDebug. r=vchang
authorHenry Chang <hchang@mozilla.com>
Tue, 25 Feb 2014 16:43:36 +0800
changeset 170618 6449c32b0ee092b6c2077f3c8a324cf444f4ac07
parent 170617 5b0eb795576633d01472c216c7d6835512468868
child 170619 59d4128d926f51e25bdc20c1011de92ca0ed609b
push id5001
push userryanvm@gmail.com
push dateWed, 26 Feb 2014 13:56:11 +0000
treeherderb2g-inbound@6449c32b0ee0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang
bugs976455
milestone30.0a1
Bug 976455 - Check p2pSupported and p2pManager in WifiWorker.js::syncDebug. r=vchang
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -291,17 +291,19 @@ var WifiManager = (function() {
 
   function syncDebug() {
     if (debugEnabled !== DEBUG) {
       let wanted = DEBUG;
       wifiCommand.setLogLevel(wanted ? "DEBUG" : "INFO", function(ok) {
         if (ok)
           debugEnabled = wanted;
       });
-      p2pManager.setDebug(DEBUG);
+      if (p2pSupported && p2pManager) {
+        p2pManager.setDebug(DEBUG);
+      }
     }
   }
 
   function getDebugEnabled(callback) {
     wifiCommand.getLogLevel(function(level) {
       if (level === null) {
         debug("Unable to get wpa_supplicant's log level");
         callback(false);