CB-14048: (android) allowedSchemes check empty string fix

This commit is contained in:
Wojciech Trocki 2018-04-27 00:07:57 +01:00
parent 5581957078
commit 57eda786e0

View File

@ -1114,8 +1114,10 @@ public class InAppBrowser extends CordovaPlugin {
// Test for whitelisted custom scheme names like mycoolapp:// or twitteroauthresponse:// (Twitter Oauth Response) // Test for whitelisted custom scheme names like mycoolapp:// or twitteroauthresponse:// (Twitter Oauth Response)
else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[a-z]*://.*?$")) { else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[a-z]*://.*?$")) {
if (allowedSchemes == null) { if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", ""); String allowed = preferences.getString("AllowedSchemes", null);
allowedSchemes = allowed.split(","); if(allowed != null) {
allowedSchemes = allowed.split(",");
}
} }
if (allowedSchemes != null) { if (allowedSchemes != null) {
for (String scheme : allowedSchemes) { for (String scheme : allowedSchemes) {