Skip to content

Commit b7f8001

Browse files
committed
[YouTube] Add check for channel items without description in search
1 parent 9b7999f commit b7f8001

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ public long getStreamCount() throws ParsingException {
9595
@Override
9696
public String getDescription() throws ParsingException {
9797
try {
98-
return getTextFromObject(channelInfoItem.getObject("descriptionSnippet"));
98+
final JsonObject descriptionObject = channelInfoItem.getObject("descriptionSnippet");
99+
100+
if (descriptionObject == null) {
101+
// Channel have no description.
102+
return null;
103+
}
104+
105+
return getTextFromObject(descriptionObject);
99106
} catch (Exception e) {
100107
throw new ParsingException("Could not get description", e);
101108
}

0 commit comments

Comments
 (0)