Skip to content

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

fixed a bug from 7856, where Snippet returned an error by mistake when Metadata was found

sixcooler2cf61a40ceb9
diff --git a/source/de/anomic/search/TextSnippet.java b/source/de/anomic/search/TextSnippet.java
index 6fe34556b..77f7a9e77 100644
--- a/source/de/anomic/search/TextSnippet.java
+++ b/source/de/anomic/search/TextSnippet.java
@@ -173,9 +173,6 @@ public class TextSnippet implements Comparable<TextSnippet>, Comparator<TextSnip
{ //encapsulate potential expensive document
final Document document = loadDocument(loader, comp, queryhashes, cacheStrategy, url, reindexing, source);
if (document == null) {
- if (this.error == null) {
- init(url.hash(), null, ResultClass.ERROR_PARSER_FAILED, "parser error/failed"); // cannot be parsed
- }
return;
}
@@ -299,6 +296,9 @@ public class TextSnippet implements Comparable<TextSnippet>, Comparator<TextSnip
init(url.hash(), null, ResultClass.ERROR_PARSER_FAILED, e.getMessage()); // cannot be parsed
return null;
}
+ if (document == null) {
+ init(url.hash(), null, ResultClass.ERROR_PARSER_FAILED, "parser error/failed"); // cannot be parsed
+ }
return document;
}