NPE check before metrics sum
This commit is contained in:
parent
4d8ef5e61f
commit
1e249cb7a5
1 changed files with 5 additions and 1 deletions
|
@ -64,7 +64,11 @@ public interface ClusterMapper {
|
|||
}
|
||||
|
||||
default BigDecimal sumMetrics(Map<String, BigDecimal> metrics) {
|
||||
if (metrics == null) {
|
||||
return metrics.values().stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
} else {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
default Path resolvePath(String path) {
|
||||
|
|
Loading…
Add table
Reference in a new issue