mirror of
https://gitee.com/arthas/arthas.git
synced 2024-12-03 12:48:48 +08:00
potential NPE in ArthasBootstrap (#1991)
This commit is contained in:
parent
a8aab52c2c
commit
e7c63d146c
@ -316,25 +316,25 @@ public class ArthasBootstrap {
|
||||
if (!location.endsWith(".properties")) {
|
||||
location = new File(location, configName + ".properties").getAbsolutePath();
|
||||
}
|
||||
}
|
||||
if (new File(location).exists()) {
|
||||
Properties properties = FileUtils.readProperties(location);
|
||||
|
||||
if (new File(location).exists()) {
|
||||
Properties properties = FileUtils.readProperties(location);
|
||||
boolean overrideAll = false;
|
||||
if (arthasEnvironment.containsProperty(CONFIG_OVERRIDE_ALL)) {
|
||||
overrideAll = arthasEnvironment.getRequiredProperty(CONFIG_OVERRIDE_ALL, boolean.class);
|
||||
} else {
|
||||
overrideAll = Boolean.parseBoolean(properties.getProperty(CONFIG_OVERRIDE_ALL, "false"));
|
||||
}
|
||||
|
||||
boolean overrideAll = false;
|
||||
if (arthasEnvironment.containsProperty(CONFIG_OVERRIDE_ALL)) {
|
||||
overrideAll = arthasEnvironment.getRequiredProperty(CONFIG_OVERRIDE_ALL, boolean.class);
|
||||
} else {
|
||||
overrideAll = Boolean.parseBoolean(properties.getProperty(CONFIG_OVERRIDE_ALL, "false"));
|
||||
}
|
||||
|
||||
PropertySource<?> propertySource = new PropertiesPropertySource(location, properties);
|
||||
if (overrideAll) {
|
||||
arthasEnvironment.addFirst(propertySource);
|
||||
} else {
|
||||
arthasEnvironment.addLast(propertySource);
|
||||
PropertySource<?> propertySource = new PropertiesPropertySource(location, properties);
|
||||
if (overrideAll) {
|
||||
arthasEnvironment.addFirst(propertySource);
|
||||
} else {
|
||||
arthasEnvironment.addLast(propertySource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user