Skip to content

Commit

Permalink
#448 code review update
Browse files Browse the repository at this point in the history
  • Loading branch information
kfchu committed Jul 27, 2018
1 parent 269ae1d commit 7716705
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@ public Integer createConfig(SystemConfig systemConfig) throws SaturnJobConsoleEx
List<SystemConfig> systemConfigs = systemConfig4SqlService.selectByProperty(systemConfig.getProperty());

boolean found = false;
for (int i = 0; i < systemConfigs.size(); i++) {
SystemConfig config = systemConfigs.get(i);
if (StringUtils.equals(config.getProperty(), systemConfig.getProperty())) {
found = true;
break;
if (systemConfigs != null) {
for (int i = 0; i < systemConfigs.size(); i++) {
SystemConfig config = systemConfigs.get(i);
if (StringUtils.equals(config.getProperty(), systemConfig.getProperty())) {
found = true;
break;
}
}
}

Expand All @@ -226,7 +228,7 @@ public Integer updateConfig(SystemConfig systemConfig) throws SaturnJobConsoleEx
properties.add(systemConfig.getProperty());
List<SystemConfig> systemConfigs = systemConfig4SqlService.selectByPropertiesAndLastly(properties);

if (systemConfigs.size() == 0) {
if (systemConfigs == null || systemConfigs.isEmpty()) {
throw new SaturnJobConsoleException(
String.format("systemConfig %s not existed, update fail", systemConfig.getProperty()));
}
Expand Down

0 comments on commit 7716705

Please sign in to comment.