cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject android commit: [CB-4280] handle invalid bridge mode request
Date Mon, 22 Jul 2013 22:15:44 GMT
Updated Branches:
  refs/heads/master b915aafb5 -> 7c7230dd3


[CB-4280] handle invalid bridge mode request


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/7c7230dd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/7c7230dd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/7c7230dd

Branch: refs/heads/master
Commit: 7c7230dd3533486ad1782bc7def215bf0fe73898
Parents: b915aaf
Author: David Kemp <drkemp@chromium.org>
Authored: Wed Jul 17 08:17:04 2013 -0400
Committer: Max Woghiren <max.woghiren@gmail.com>
Committed: Mon Jul 22 18:15:09 2013 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaChromeClient.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/7c7230dd/framework/src/org/apache/cordova/CordovaChromeClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaChromeClient.java b/framework/src/org/apache/cordova/CordovaChromeClient.java
index 62a4eef..5299bc5 100755
--- a/framework/src/org/apache/cordova/CordovaChromeClient.java
+++ b/framework/src/org/apache/cordova/CordovaChromeClient.java
@@ -228,8 +228,13 @@ public class CordovaChromeClient extends WebChromeClient {
 
         // Sets the native->JS bridge mode. 
         else if (reqOk && defaultValue != null && defaultValue.equals("gap_bridge_mode:"))
{
-            this.appView.exposedJsApi.setNativeToJsBridgeMode(Integer.parseInt(message));
-            result.confirm("");
+        	try {
+                this.appView.exposedJsApi.setNativeToJsBridgeMode(Integer.parseInt(message));
+                result.confirm("");
+        	} catch (NumberFormatException e){
+                result.confirm("");
+                e.printStackTrace();
+        	}
         }
 
         // Polling for JavaScript messages 


Mime
View raw message