Charles Chan
Committed by Charles Chan

Bugfix: default value is not applied to config correctly

This could further cause NPE somewhere else where a default value is expected

Change-Id: I71c8f87b5e25b6e5445e03527ee82d84ff05086c
...@@ -322,7 +322,7 @@ public abstract class Config<S> { ...@@ -322,7 +322,7 @@ public abstract class Config<S> {
322 */ 322 */
323 protected <E extends Enum<E>> E get(String name, E defaultValue, Class<E> enumClass) { 323 protected <E extends Enum<E>> E get(String name, E defaultValue, Class<E> enumClass) {
324 if (defaultValue != null) { 324 if (defaultValue != null) {
325 - Enum.valueOf(enumClass, object.path(name).asText(defaultValue.toString())); 325 + return Enum.valueOf(enumClass, object.path(name).asText(defaultValue.toString()));
326 } 326 }
327 327
328 JsonNode node = object.get(name); 328 JsonNode node = object.get(name);
......