Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE in RestPluginsAction #52620

Merged
merged 2 commits into from
Feb 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -96,8 +97,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