Handle missing actions when parsing WatchStatus
Original commit: elastic/x-pack-elasticsearch@b868aa1a62
This commit is contained in:
parent
2bde3de3f0
commit
f18b66fdc4
|
@ -28,6 +28,7 @@ import java.io.IOException;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static java.util.Collections.unmodifiableMap;
|
||||
import static org.elasticsearch.watcher.support.WatcherDateTimeUtils.parseDate;
|
||||
import static org.elasticsearch.watcher.support.WatcherDateTimeUtils.readDate;
|
||||
|
@ -326,8 +327,9 @@ public class WatchStatus implements ToXContent, Streamable {
|
|||
if (state == null) {
|
||||
state = new State(true, WatcherXContentParser.clock(parser).nowUTC());
|
||||
}
|
||||
actions = actions == null ? emptyMap() : unmodifiableMap(actions);
|
||||
|
||||
return new WatchStatus(-1, state, lastChecked, lastMetCondition, unmodifiableMap(actions));
|
||||
return new WatchStatus(-1, state, lastChecked, lastMetCondition, actions);
|
||||
}
|
||||
|
||||
public static class State implements ToXContent {
|
||||
|
|
Loading…
Reference in New Issue