Skip to content

Commit

Permalink
[SCB-2752] Filter out configurations with empty values (#3587)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghao605 authored Jan 29, 2023
1 parent ab0d9eb commit a144631
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ private void getProperties(ConfigurableEnvironment environment, PropertySource<?
EnumerablePropertySource<?> enumerablePropertySource = (EnumerablePropertySource<?>) propertySource;
for (String propertyName : enumerablePropertySource.getPropertyNames()) {
try {
configFromSpringBoot.put(propertyName, environment.getProperty(propertyName, Object.class));
Object propertyValue = environment.getProperty(propertyName, Object.class);
if (propertyValue == null) {
LOGGER.error("The value of a configuration item is null, please check whether there is any impact, config item key: {}", propertyName);
continue;
}
configFromSpringBoot.put(propertyName, propertyValue);
} catch (Exception e) {
throw new RuntimeException(
"set up spring property source failed.If you still want to start up the application and ignore errors, you can set servicecomb.config.ignoreResolveFailure to true.",
Expand Down

0 comments on commit a144631

Please sign in to comment.