[YouTube] Add check for channel items without description in search
This commit is contained in:
parent
9b7999fe54
commit
b7f8001a49
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue