Fix su stbGestSetup nulle

This commit is contained in:
Giuseppe Scorrano 2023-03-08 17:19:27 +01:00
parent 5e52d83c40
commit df48ea3b32

View File

@ -413,16 +413,19 @@ public class SettingsManager {
StbGestSetup value = Stream.of(stbGestSetupList)
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
.findFirstOrElse(new StbGestSetup());
.findFirstOrElse(null);
if(value != null) {
if (clazz == String.class) {
return clazz.cast(value.getValue());
} else if (clazz == Boolean.class) {
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
} else if (clazz == Integer.class && value.getValue() != null) {
return clazz.cast(Integer.parseInt(value.getValue()));
} else return defaultValue;
}
}
return defaultValue;
}
}