Fix NPE in InAppBrowser.

When cordova.getActivity().getIntent().getExtras() == null.
This commit is contained in:
Andrew Grieve
2013-03-23 14:07:57 -04:00
parent 85c25630a8
commit cdbe9c7204

View File

@@ -445,7 +445,7 @@ public class InAppBrowser extends CordovaPlugin {
//Toggle whether this is enabled or not!
Bundle appSettings = cordova.getActivity().getIntent().getExtras();
boolean enableDatabase = appSettings.getBoolean("InAppBrowserStorageEnabled", true);
boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true);
if(enableDatabase)
{
String databasePath = cordova.getActivity().getApplicationContext().getDir("inAppBrowserDB", Context.MODE_PRIVATE).getPath();