Cat nodes api: prevent NPEs in case there are multiple client nodes
If you connect to a client node and call _cat/nodes, and there is at least another client node in the cluster, the http address cannot be retrieved thus we get an NPE. This commit prevents an NPE from being thrown. This bug was introduced with #16770
This commit is contained in:
parent
8182a282d4
commit
a70be3a10f
|
@ -249,7 +249,7 @@ public class RestNodesAction extends AbstractCatAction {
|
|||
} else {
|
||||
table.addCell("-");
|
||||
}
|
||||
final Map<String, String> serviceAttributes = info.getServiceAttributes();
|
||||
final Map<String, String> serviceAttributes = info == null ? null : info.getServiceAttributes();
|
||||
if (serviceAttributes != null) {
|
||||
table.addCell(serviceAttributes.getOrDefault("http_address", "-"));
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue