Skip to content

Commit 4c15018

Browse files
authored
Merge pull request #283 from thuongtv-vn/error-no-such-key-exception
fix(android): Fix error com.facebook.react.bridge.NoSuchKeyException
2 parents 214b111 + 40b7633 commit 4c15018

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

android/src/main/java/com/proyecto26/inappbrowser/RNInAppBrowser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ public class RNInAppBrowser {
6464
private static final Pattern animationIdentifierPattern = Pattern.compile("^.+:.+/");
6565

6666
public Integer setColor(CustomTabsIntent.Builder builder, final ReadableMap options, String key, String method, String colorName) {
67-
String colorString = options.getString(key);
67+
String colorString = null;
6868
Integer color = null;
6969
try {
70-
if (colorString != null) {
70+
if (options.hasKey(key)) {
71+
colorString = options.getString(key);
7172
color = Color.parseColor(colorString);
7273
Method findMethod = builder.getClass().getDeclaredMethod(method, int.class);
7374
findMethod.invoke(builder, color);

0 commit comments

Comments
 (0)