Don’t write job description if not set

Original commit: elastic/x-pack-elasticsearch@6e7ff939d3
This commit is contained in:
David Kyle 2016-12-19 11:27:32 +00:00
parent 854dc88cbd
commit 4eda09d24a
1 changed files with 3 additions and 1 deletions

View File

@ -417,7 +417,9 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContent
public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException {
builder.field(ID.getPreferredName(), jobId);
builder.field(DESCRIPTION.getPreferredName(), description);
if (description != null) {
builder.field(DESCRIPTION.getPreferredName(), description);
}
builder.field(CREATE_TIME.getPreferredName(), createTime.getTime());
if (finishedTime != null) {
builder.field(FINISHED_TIME.getPreferredName(), finishedTime.getTime());