Commit 06dab837 authored by TobiGr's avatar TobiGr
Browse files

Catch possible NPE

parent 3875f625
......@@ -107,11 +107,13 @@ public class YoutubeSearchExtractor extends SearchExtractor {
"&page=" + Integer.toString(pageNr + 1));
}
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException {
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException, ParsingException {
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
Element list = doc.select("ol[class=\"item-section\"]").first();
if (list == null) {
throw new ParsingException("Could not get search result items", doc);
}
for (Element item : list.children()) {
/* First we need to determine which kind of item we are working with.
Youtube depicts five different kinds of items on its search result page. These are
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment