lightbend / config

configuration library for JVM languages using HOCON files
https://lightbend.github.io/config/
6.12k stars 968 forks source link

hasPathOrNull("") yields an error message that does not correspond to the problem #764

Open ljnelson opened 2 years ago

ljnelson commented 2 years ago

While accidentally doing horrible things with hasPathOrNull(String), I managed to pass an empty string. The error message said, in part:

com.typesafe.config.ConfigException$BadPath: path parameter: Invalid path '': path has a leading, trailing, or two adjacent period '.' (use quoted "" empty string if you want an empty element)

I assume that indeed an empty string should be a problem (though it could be used to return the thing itself), but this error message momentarily confused me.