Skip to content

Commit d98f81b

Browse files
committed
Fix detection of invalid textObject in getTextFromObject()
a
1 parent 49157fc commit d98f81b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeParsingHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ public static String getUrlFromNavigationEndpoint(JsonObject navigationEndpoint)
391391
* @return text in the JSON object or an empty string
392392
*/
393393
public static String getTextFromObject(JsonObject textObject, boolean html) throws ParsingException {
394+
if (textObject == null || textObject.isEmpty()) {
395+
return null;
396+
}
397+
394398
if (textObject.has("simpleText")) return textObject.getString("simpleText");
395399

396400
StringBuilder textBuilder = new StringBuilder();

0 commit comments

Comments
 (0)