Skip to content

Commit 3f7fb81

Browse files
committed
fix NPE in TransportGetDeploymentStatsAction
1 parent e0f4cff commit 3f7fb81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static GetDeploymentStatsAction.Response addFailedRoutes(
231231
}
232232
}
233233

234-
updatedNodeStats.sort(Comparator.comparing(n -> n.getNode().getId()));
234+
updatedNodeStats.sort(Comparator.comparing(n -> n.getNode() != null ? n.getNode().getId() : ""));
235235
updatedAssignmentStats.add(
236236
new AssignmentStats(
237237
stat.getDeploymentId(),
@@ -270,7 +270,7 @@ static GetDeploymentStatsAction.Response addFailedRoutes(
270270
);
271271
}
272272

273-
nodeStats.sort(Comparator.comparing(n -> n.getNode().getId()));
273+
nodeStats.sort(Comparator.comparing(n -> n.getNode() != null ? n.getNode().getId() : ""));
274274

275275
updatedAssignmentStats.add(
276276
new AssignmentStats(

0 commit comments

Comments
 (0)