Closed rwperrott closed 3 years ago
null == toml.getMap(key) ? null : toml.getAs(key, cls)
seems to do the trick.
I've also noticed that properties in an object values, with provided default values are overwritten by getAs, which seems a bit off, because you can't get automatic default values... It'd be better to get the default property value using getOrDefault, with that value as the default, then set the property to the resulting value.
Lost interest.
Exceptions should not be used for flow control, so if the key is missing, null should be returned. I'll have to see if I can detect the absence of just the key, as a workaround for this bug, until it's fixed.