File tree 1 file changed +8
-6
lines changed
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -202,11 +202,13 @@ public Integer createConfig(SystemConfig systemConfig) throws SaturnJobConsoleEx
202
202
List <SystemConfig > systemConfigs = systemConfig4SqlService .selectByProperty (systemConfig .getProperty ());
203
203
204
204
boolean found = false ;
205
- for (int i = 0 ; i < systemConfigs .size (); i ++) {
206
- SystemConfig config = systemConfigs .get (i );
207
- if (StringUtils .equals (config .getProperty (), systemConfig .getProperty ())) {
208
- found = true ;
209
- break ;
205
+ if (systemConfigs != null ) {
206
+ for (int i = 0 ; i < systemConfigs .size (); i ++) {
207
+ SystemConfig config = systemConfigs .get (i );
208
+ if (StringUtils .equals (config .getProperty (), systemConfig .getProperty ())) {
209
+ found = true ;
210
+ break ;
211
+ }
210
212
}
211
213
}
212
214
@@ -226,7 +228,7 @@ public Integer updateConfig(SystemConfig systemConfig) throws SaturnJobConsoleEx
226
228
properties .add (systemConfig .getProperty ());
227
229
List <SystemConfig > systemConfigs = systemConfig4SqlService .selectByPropertiesAndLastly (properties );
228
230
229
- if (systemConfigs . size () == 0 ) {
231
+ if (systemConfigs == null || systemConfigs . isEmpty () ) {
230
232
throw new SaturnJobConsoleException (
231
233
String .format ("systemConfig %s not existed, update fail" , systemConfig .getProperty ()));
232
234
}
You can’t perform that action at this time.
0 commit comments