File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1111
1212public final class EnvUtil {
1313 private static final Logger LOGGER = LoggerFactory .getLogger (EnvUtil .class );
14- private static final Map <String , String > ARGS ;
14+ private static final Map <String , String > ARGS = new HashMap <>() ;
1515
1616 static {
1717 try {
1818 String args = getEnv (Const .Config .ARGS_JSON );
19- TypeReference <HashMap <String ,String >> typeRef = new TypeReference <>() {};
20- ARGS = Mapper .OBJECT_MAPPER .readValue (args , typeRef );
19+
20+ if (StringUtils .isNotBlank (args )) {
21+ TypeReference <HashMap <String , String >> typeRef = new TypeReference <>() {
22+ };
23+ ARGS .putAll (Mapper .OBJECT_MAPPER .readValue (args , typeRef ));
24+ }
2125 } catch (JsonProcessingException e ) {
22- throw new RuntimeException (e );
26+ LOGGER .error (e ::getMessage );
27+ System .exit (1 );
2328 }
2429 }
2530
You can’t perform that action at this time.
0 commit comments