Guard for when result.getPropertySources() is null.
fixes gh-488
This commit is contained in:
@@ -96,12 +96,14 @@ public class ConfigServicePropertySourceLocator implements PropertySourceLocator
|
||||
result.getProfiles() == null ? "" : Arrays.asList(result.getProfiles()),
|
||||
result.getLabel(), result.getVersion(), result.getState()));
|
||||
|
||||
for (PropertySource source : result.getPropertySources()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> map = (Map<String, Object>) source
|
||||
.getSource();
|
||||
composite.addPropertySource(new MapPropertySource(source
|
||||
.getName(), map));
|
||||
if (result.getPropertySources() != null) { // result.getPropertySources() can be null if using xml
|
||||
for (PropertySource source : result.getPropertySources()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> map = (Map<String, Object>) source
|
||||
.getSource();
|
||||
composite.addPropertySource(new MapPropertySource(source
|
||||
.getName(), map));
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(result.getState()) || StringUtils.hasText(result.getVersion())) {
|
||||
|
||||
Reference in New Issue
Block a user