Skip to content

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

include/exclude size NPE fix (recently added)

Michael Peter Christenae55d69ef6d5
diff --git a/source/net/yacy/search/query/QueryGoal.java b/source/net/yacy/search/query/QueryGoal.java
index 318ba6aef..9bd4f9377 100644
--- a/source/net/yacy/search/query/QueryGoal.java
+++ b/source/net/yacy/search/query/QueryGoal.java
@@ -209,13 +209,13 @@ public class QueryGoal {
}
public int getIncludeSize() {
- assert this.include_hashes.size() == this.include_words.size();
- return this.include_words.size();
+ assert this.include_hashes == null || this.include_words.size() == 0 || this.include_hashes.size() == this.include_words.size();
+ return this.include_hashes == null ? this.include_words.size() : this.include_hashes.size();
}
public int getExcludeSize() {
- assert this.exclude_hashes.size() == this.exclude_words.size();
- return this.exclude_words.size();
+ assert this.exclude_hashes == null || this.exclude_words.size() == 0 || this.exclude_hashes.size() == this.exclude_words.size();
+ return this.exclude_hashes == null ? this.exclude_words.size() : this.exclude_hashes.size();
}
/**