(warc) Fix NPE in WarcRecorder

This commit is contained in:
Viktor Lofgren 2023-12-25 00:54:38 +01:00
parent 1755b646b8
commit c5aab7e8db

View File

@ -289,10 +289,12 @@ public class CrawlerRetreiver implements AutoCloseable {
new ContentType(doc.contentType, "UTF-8"), new ContentType(doc.contentType, "UTF-8"),
doc.documentBody); doc.documentBody);
var parsed = Jsoup.parse(doc.documentBody); if (doc.documentBody != null) {
var parsed = Jsoup.parse(doc.documentBody);
crawlFrontier.enqueueLinksFromDocument(top, parsed); crawlFrontier.enqueueLinksFromDocument(top, parsed);
crawlFrontier.addVisited(top); crawlFrontier.addVisited(top);
}
} }
else if (fetchedDoc instanceof HttpFetchResult.ResultException ex) { else if (fetchedDoc instanceof HttpFetchResult.ResultException ex) {
errorCount ++; errorCount ++;