You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/02/12 20:33:07 UTC

[16/50] js commit: Update lib/webos/plugin/webos/network.js

Update lib/webos/plugin/webos/network.js

handle not existing fields of connection manager service response (provided by morphis)


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/67f1c6ea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/67f1c6ea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/67f1c6ea

Branch: refs/heads/symbolmapping
Commit: 67f1c6ea8facf990590eb930a14a64e88eee5fa2
Parents: 41c63c9
Author: ghtomcat <ml...@yahoo.com>
Authored: Fri Feb 8 11:27:41 2013 +0100
Committer: hermwong <he...@gmail.com>
Committed: Mon Feb 11 14:53:02 2013 -0800

----------------------------------------------------------------------
 lib/webos/plugin/webos/network.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/67f1c6ea/lib/webos/plugin/webos/network.js
----------------------------------------------------------------------
diff --git a/lib/webos/plugin/webos/network.js b/lib/webos/plugin/webos/network.js
index 3f8f8f8..504841f 100644
--- a/lib/webos/plugin/webos/network.js
+++ b/lib/webos/plugin/webos/network.js
@@ -41,8 +41,8 @@ module.exports = {
 
                 var info={};
                 if (!result.isInternetConnectionAvailable) { info.type=Connection.NONE; }
-                if (result.wifi.onInternet) { info.type=Connection.WIFI; }
-                if (result.wan.state==="connected") { info.type=Connection.CELL_2G; }
+                if (result.wifi && result.wifi.onInternet) { info.type=Connection.WIFI; }
+                if (result.wan && result.wan.state==="connected") { info.type=Connection.CELL_2G; }
 
                 successCallback(info.type);
             },