From b1ec0644e5bd4bc8d5438c5fb1dab3adb53a95e2 Mon Sep 17 00:00:00 2001 From: reger Date: Tue, 31 Mar 2015 02:20:13 +0200 Subject: [PATCH] fix NPE in location search on missing/empty PubDate in underlaying rss data --- htroot/yacysearch_location.java | 2 +- .../yacy/cora/document/feed/RSSMessage.java | 22 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/htroot/yacysearch_location.java b/htroot/yacysearch_location.java index 0f1f7212b..d1250dc9e 100644 --- a/htroot/yacysearch_location.java +++ b/htroot/yacysearch_location.java @@ -113,7 +113,7 @@ public class yacysearch_location { prop.put("kml_placemark_" + placemarkCounter + "_copyright", message.getCopyright()); prop.put("kml_placemark_" + placemarkCounter + "_subject", message.getSubject()); prop.put("kml_placemark_" + placemarkCounter + "_description", message.getDescriptions().size() > 0 ? message.getDescriptions().get(0) : ""); - prop.put("kml_placemark_" + placemarkCounter + "_date", message.getPubDate()); + prop.put("kml_placemark_" + placemarkCounter + "_date", (message.getPubDate() != null) ? message.getPubDate() : new Date()); prop.putXML("kml_placemark_" + placemarkCounter + "_url", message.getLink()); prop.put("kml_placemark_" + placemarkCounter + "_pointname", message.getTitle()); prop.put("kml_placemark_" + placemarkCounter + "_lon", lo); diff --git a/source/net/yacy/cora/document/feed/RSSMessage.java b/source/net/yacy/cora/document/feed/RSSMessage.java index fac200167..aea58547e 100644 --- a/source/net/yacy/cora/document/feed/RSSMessage.java +++ b/source/net/yacy/cora/document/feed/RSSMessage.java @@ -212,20 +212,26 @@ public class RSSMessage implements Hit, Comparable, Comparator