Skip to content

Commit

Permalink
[7.6] fix npe in RestPluginsAction (#52620) (de56de9) (#52722)
Browse files Browse the repository at this point in the history
Relates #45321

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Kaihong.Wang <kyra.wkh@alibaba-inc.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 24, 2020
1 parent ff0053f commit b217f31
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.client.node.NodeClient;
Expand Down Expand Up @@ -94,8 +95,14 @@ private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoR

for (DiscoveryNode node : nodes) {
NodeInfo info = nodesInfo.getNodesMap().get(node.getId());

for (PluginInfo pluginInfo : info.getPlugins().getPluginInfos()) {
if (info == null) {
continue;
}
PluginsAndModules plugins = info.getPlugins();
if (plugins == null) {
continue;
}
for (PluginInfo pluginInfo : plugins.getPluginInfos()) {
table.startRow();
table.addCell(node.getId());
table.addCell(node.getName());
Expand Down

0 comments on commit b217f31

Please sign in to comment.