Skip to content

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

add null pointer check to stopword fix

regerd367b1f4d994
diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java
index f4e6a44e3..7a57722b6 100644
--- a/source/net/yacy/search/query/SearchEvent.java
+++ b/source/net/yacy/search/query/SearchEvent.java
@@ -387,11 +387,13 @@ public final class SearchEvent {
// only with the query minus the stopwords which had not been used for the search
boolean filtered = false;
// check if query contains stopword
- Iterator<byte[]> it = query.getQueryGoal().getIncludeHashes().iterator();
- while (it.hasNext()) {
- if (Switchboard.stopwordHashes.contains((it.next()))) {
- filtered = true;
- break;
+ if (Switchboard.stopwordHashes != null) {
+ Iterator<byte[]> it = query.getQueryGoal().getIncludeHashes().iterator();
+ while (it.hasNext()) {
+ if (Switchboard.stopwordHashes.contains((it.next()))) {
+ filtered = true;
+ break;
+ }
}
}
this.snippetFetchWordHashes = query.getQueryGoal().getIncludeHashes().clone();