From b7f8001a49fd963d008a02e64f7bd8ff1239548b Mon Sep 17 00:00:00 2001 From: Mauricio Colli Date: Sat, 21 Mar 2020 03:15:51 -0300 Subject: [PATCH] [YouTube] Add check for channel items without description in search --- .../extractors/YoutubeChannelInfoItemExtractor.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java index 09e984085..15211da7e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelInfoItemExtractor.java @@ -95,7 +95,14 @@ public class YoutubeChannelInfoItemExtractor implements ChannelInfoItemExtractor @Override public String getDescription() throws ParsingException { try { - return getTextFromObject(channelInfoItem.getObject("descriptionSnippet")); + final JsonObject descriptionObject = channelInfoItem.getObject("descriptionSnippet"); + + if (descriptionObject == null) { + // Channel have no description. + return null; + } + + return getTextFromObject(descriptionObject); } catch (Exception e) { throw new ParsingException("Could not get description", e); }