mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-06 04:36:17 +02:00
Fix NPE when component can't be found
Change-Id: I803240cde2d2b2c5efeee03617d0e3a275a2f570
This commit is contained in:
parent
a8f4840e86
commit
7981a32f37
@ -379,6 +379,11 @@ public class ComponentConfigManager implements ComponentConfigService {
|
||||
try {
|
||||
Configuration cfg = cfgAdmin.getConfiguration(componentName, null);
|
||||
Map<String, ConfigProperty> map = properties.get(componentName);
|
||||
if (map == null) {
|
||||
// Prevent NPE if the component isn't there
|
||||
log.warn("Component not found for " + componentName);
|
||||
return;
|
||||
}
|
||||
Dictionary<String, Object> props = new Hashtable<>();
|
||||
map.values().stream().filter(p -> p.value() != null)
|
||||
.forEach(p -> props.put(p.name(), p.value()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user