stats: fix npe during serialization

Original commit: elastic/x-pack-elasticsearch@3233836d0b
This commit is contained in:
Martijn van Groningen 2015-05-21 11:38:24 +02:00
parent 60c7e92ced
commit 284a60e16d

View File

@ -17,6 +17,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.watcher.execution.WatchExecutionSnapshot;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@ -121,6 +122,7 @@ public class WatcherStatsResponse extends ActionResponse implements ToXContent {
if (in.readBoolean()) {
int size = in.readVInt();
snapshots = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
snapshots.add(new WatchExecutionSnapshot(in));
}