[CB-4280] handle invalid bridge mode request

This commit is contained in:
David Kemp 2013-07-17 08:17:04 -04:00 committed by Max Woghiren
parent b915aafb5b
commit 7c7230dd35

View File

@ -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