mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
Fix some bugs in JSON+LD-heuristics for pub date.
This commit is contained in:
parent
44b1fe0e6d
commit
21125206b4
@ -45,7 +45,7 @@ public class PubDateHeuristicJSONLD implements PubDateHeuristic {
|
|||||||
return Optional.ofNullable(model.getDatePublished());
|
return Optional.ofNullable(model.getDatePublished());
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (JsonSyntaxException ex) {
|
catch (JsonSyntaxException|NumberFormatException|NullPointerException ex) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ class JsonModel {
|
|||||||
for (var item : Objects.requireNonNullElse(graph,
|
for (var item : Objects.requireNonNullElse(graph,
|
||||||
Collections.<JsonModelGraphItem>emptyList()))
|
Collections.<JsonModelGraphItem>emptyList()))
|
||||||
{
|
{
|
||||||
if (!item.isRelevant())
|
if (null == item || !item.isRelevant())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (item.datePublished != null)
|
if (item.datePublished != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user