From bedcd87abb4d53cfd38f6c7e53be7d66caddbe8f Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Thu, 20 May 2021 21:23:31 +0200 Subject: [PATCH] Fixed occurrences where voteCount is not set (<=0 likes) --- .../youtube/extractors/YoutubeCommentsInfoItemExtractor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsInfoItemExtractor.java index 24798da8..fa411777 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsInfoItemExtractor.java @@ -91,6 +91,11 @@ public class YoutubeCommentsInfoItemExtractor implements CommentsInfoItemExtract * 6 */ try { + // Sometimes the voteCount is missing + if(!json.has("voteCount")) { + return EMPTY_STRING; + } + final JsonObject voteCountObj = JsonUtils.getObject(json, "voteCount"); if(voteCountObj.isEmpty()) { return EMPTY_STRING;