diff --git a/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java b/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java index fe0c8a96838..fad5b4c0194 100644 --- a/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java @@ -114,6 +114,9 @@ public class FsInfo implements Iterable, Writeable, ToXContentFragm } private long addLong(long current, long other) { + if (current == -1 && other == -1) { + return 0; + } if (other == -1) { return current; } @@ -124,6 +127,9 @@ public class FsInfo implements Iterable, Writeable, ToXContentFragm } private double addDouble(double current, double other) { + if (current == -1 && other == -1) { + return 0; + } if (other == -1) { return current; }