fix: remove unnecessary latLng variable and return null directly

This commit is contained in:
Rsedp8 2025-05-24 17:04:54 +02:00
parent e81abaa1e4
commit 10479a01b7

View file

@ -16,12 +16,12 @@ object LocationUtils {
val indexOfPrefix = customQuery.indexOf("Point(")
if (indexOfPrefix == -1) {
Timber.e("Invalid prefix index - Seems like user has entered an invalid query")
return latLng
return null
}
val indexOfSuffix = customQuery.indexOf(")\"", indexOfPrefix)
if (indexOfSuffix == -1) {
Timber.e("Invalid suffix index - Seems like user has entered an invalid query")
return latLng
return null
}
val latLngString = customQuery.substring(indexOfPrefix + "Point(".length, indexOfSuffix)
if (latLngString.isEmpty()) {