Skip to content

Commit 13dad83

Browse files
authored
Parse icon only if it is defined (#6333)
We always parsed icons, even if they are undefined. This addresses the JSON parse exception stack trace users often saw when opening the app.
1 parent fbe81d0 commit 13dad83

File tree

1 file changed

+1
-1
lines changed
  • lib/android/app/src/main/java/com/reactnativenavigation/parse/parsers

1 file changed

+1
-1
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/parse/parsers/IconParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
public class IconParser {
1212
public static Text parse(@Nullable JSONObject json, String key) {
13-
if (json == null) return new NullText();
13+
if (json == null || !json.has(key)) return new NullText();
1414
try {
1515
return json.get(key) instanceof String ? TextParser.parse(json, key) : TextParser.parse(json.optJSONObject(key), "uri");
1616
} catch (JSONException e) {

0 commit comments

Comments
 (0)