From cb6ca43fb971a6e0d06570af3ebf99812f396524 Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Wed, 18 Jan 2023 10:00:05 +0000 Subject: [PATCH] RMET-2119 InAppBrowser Plugin - Check for element before obtaining it (#40) (#41) * fix: check if there's a next token before trying to obtain it References: https://outsystemsrd.atlassian.net/browse/RMET-2119 * chore: update changelog --- CHANGELOG.md | 4 ++++ src/android/InAppBrowser.java | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 788500d06..94ee8e893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [Unreleased] +### Fix +- Android - InAppBrowser not opening when no options are passed - check for next element before trying to obtain. (https://outsystemsrd.atlassian.net/browse/RMET-2119) + ### [4.0.0-OS12] - 2022-06-29 ### Fix - Removed hook that adds swift support and added the plugin as dependecy. (https://outsystemsrd.atlassian.net/browse/RMET-1680) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index aa0d40d36..dad557268 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -446,11 +446,13 @@ private HashMap parseFeature(String optString) { option = new StringTokenizer(features.nextToken(), "="); if (option.hasMoreElements()) { String key = option.nextToken(); - String value = option.nextToken(); - if (!customizableOptions.contains(key)) { - value = value.equals("yes") || value.equals("no") ? value : "yes"; + if(option.hasMoreElements()){ + String value = option.nextToken(); + if (!customizableOptions.contains(key)) { + value = value.equals("yes") || value.equals("no") ? value : "yes"; + } + map.put(key, value); } - map.put(key, value); } } return map;