What would you expect the following to return if the property isn’t defined?
grailsApplication.config.unknownproperty
a. Returns null
b. Returns an empty string`
c. Throws an exception
d. None of the above
Answer: d. None of the above
In reality, the above situation returns an empty Groovy ConfigObject instance. If you want to know if the property exists you need to do something like:
if (grailsApplication.config.containsKey('unknownproperty')