Skip to content

Commit

Permalink
Fix detection of invalid textObject in getTextFromObject()
Browse files Browse the repository at this point in the history
a
  • Loading branch information
TobiGr committed Apr 26, 2020
1 parent 49157fc commit d98f81b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ public static String getUrlFromNavigationEndpoint(JsonObject navigationEndpoint)
* @return text in the JSON object or an empty string
*/
public static String getTextFromObject(JsonObject textObject, boolean html) throws ParsingException {
if (textObject == null || textObject.isEmpty()) {
return null;
}

if (textObject.has("simpleText")) return textObject.getString("simpleText");

StringBuilder textBuilder = new StringBuilder();
Expand Down

0 comments on commit d98f81b

Please sign in to comment.