Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix NPE on viewfile of url not in index

reger66d0b5046a02
diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java
index 00ae68aaf..f6fceefc5 100644
--- a/htroot/ViewFile.java
+++ b/htroot/ViewFile.java
@@ -376,8 +376,8 @@ public class ViewFile {
prop.put("showSnippet_teasertext", desc);
prop.put("showSnippet", 1);
}
- // update index with parsed resouce if index entry is older
- if (urlEntry.loaddate().before(response.lastModified())) {
+ // update index with parsed resouce if index entry is older or missing
+ if (urlEntry == null || urlEntry.loaddate().before(response.lastModified())) {
Switchboard.getSwitchboard().toIndexer(response);
}
if (document != null) document.close();