Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
6.0
-
None
-
New, Patch Available
Description
In the file BoostQueryNode.java, getChild could be null and it is being dereferenced in the function toString().
BoostQueryNode.java
public QueryNode getChild() { List<QueryNode> children = getChildren(); if (children == null || children.size() == 0) { return null; } return children.get(0); }
BoostQueryNode.java
public String toString() { return "<boost value='" + getValueString() + "'>" + "\n" + getChild().toString() + "\n</boost>"; }
Should we not check if getChild is valid?
Probable fix
String s = (getChild() != null) ? getChild().toString() : "null"; return "<boost value='" + getValueString() + "'>" + "\n" + s + "\n</boost>";