Skip to content

Commit 76eeaba

Browse files
authored
Merge pull request #1020 from TeamNewPipe/fix/yt-subscriber-count
[YouTube] Fix NPE in search when getting channel items without subscriber count
2 parents 0e4e6a9 + 7257393 commit 76eeaba

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ public long getSubscriberCount() throws ParsingException {
9696
}
9797

9898
if (withHandle) {
99-
return Utils.mixedNumberWordToLong(getTextFromObject(
100-
channelInfoItem.getObject("videoCountText")));
99+
if (channelInfoItem.has("videoCountText")) {
100+
return Utils.mixedNumberWordToLong(getTextFromObject(
101+
channelInfoItem.getObject("videoCountText")));
102+
} else {
103+
return -1;
104+
}
101105
}
102106

103107
return Utils.mixedNumberWordToLong(getTextFromObject(

0 commit comments

Comments
 (0)