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 f4d5914511
commit ca03e40605
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) {