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 0c74090953
commit 73c7994cd1

View File

@ -460,7 +460,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();