Internal: Ensure that explanation descriptions are not null on serialization.

As requested on #10399
This commit is contained in:
Adrien Grand 2015-04-20 23:58:28 +02:00
parent 24d1f595a5
commit b69e7e4d35
1 changed files with 3 additions and 0 deletions

View File

@ -559,6 +559,9 @@ public class Lucene {
out.writeBoolean(false);
}
out.writeFloat(explanation.getValue());
if (explanation.getDescription() == null) {
throw new ElasticsearchIllegalArgumentException("Explanation descriptions should NOT be null\n[" + explanation.toString() + "]");
}
out.writeString(explanation.getDescription());
Explanation[] subExplanations = explanation.getDetails();
if (subExplanations == null) {