summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@oath.com>2018-01-12 18:16:45 +0100
committerHåkon Hallingstad <hakon@oath.com>2018-01-12 18:16:45 +0100
commit17a1fdea67924c594001227f57917edbe513df23 (patch)
tree739614fd566303dd63bda5cd44da5bcad5878fa1 /node-admin
parent5c06d93019fb638f516fd26a1f103894261b8ceb (diff)
Detect bad component reference
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminMain.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminMain.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminMain.java
index 46a04d71b92..6fd6b0c906c 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminMain.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminMain.java
@@ -77,7 +77,13 @@ public class NodeAdminMain implements AutoCloseable {
});
for (String componentSpecificationString : config.components) {
- enable(adminRegistry.getComponent(componentSpecificationString));
+ AdminComponent component =
+ adminRegistry.getComponent(componentSpecificationString);
+ if (component == null) {
+ throw new IllegalArgumentException("There is no component named '" +
+ componentSpecificationString + "'");
+ }
+ enable(component);
}
}
}