Closed SufianBabri closed 4 years ago
TBH, I think the library should throw an IllegalArgumentException
in that case and that's also an unchecked exception so I would only put it in the javadoc. Thanks for reporting this though, I will take a look.
I will release this as 1.5.0
First of all, a big thanks to the contributors and the maintainers of this great library.
Now coming to the actual issue... The method
GeoHash.fromGeohashString()
throws NullPointerException if the argument is not a valid GeoHash (e.g.aaaaaa
,sggfha
).Background: Actually we faced the crash in our app because somehow an invalid geohash made into our server's DB and the app started crashing due to NPE.
Suggestion/request: Can a
throws NullPointerException
be added to the method signature so that the developers are aware that passing an invalid argument will throw an exception?Since NPE is not a checked exception, the library will stay backwards compatible.