Add additional null check in _cat/shards
The target of the func lambda may be null (e.g. in a mixed cluster
where older nodes lack some of the values)
Relates: /
@@ -195,8 +195,10 @@ public class RestShardsAction extends AbstractCatAction {
private static <S, T> Object getOrNull(S stats, Function<S, T> accessor, Function<T, Object> func) {
if(stats != null) {
T t = accessor.apply(stats);
+ if (t != null) {
return func.apply(t);
}
+ }
return null;
}
