From 57eda786e072bd54385319fc932cc6b95f363aa5 Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Fri, 27 Apr 2018 00:07:57 +0100 Subject: [PATCH] CB-14048: (android) allowedSchemes check empty string fix --- src/android/InAppBrowser.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index 9b3388ced..e6309286d 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -1114,8 +1114,10 @@ else if (url.startsWith("sms:")) { // 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]*://.*?$")) { if (allowedSchemes == null) { - String allowed = preferences.getString("AllowedSchemes", ""); - allowedSchemes = allowed.split(","); + String allowed = preferences.getString("AllowedSchemes", null); + if(allowed != null) { + allowedSchemes = allowed.split(","); + } } if (allowedSchemes != null) { for (String scheme : allowedSchemes) {