mirror of https://github.com/tasks/tasks
Fix Mapbox reverse geocoding when address is null
parent
9fe67f5593
commit
e16cadc374
@ -0,0 +1,9 @@
|
||||
package org.tasks.extensions
|
||||
|
||||
import com.google.gson.JsonObject
|
||||
|
||||
object JsonObject {
|
||||
fun JsonObject.getStringOrNull(key: String): String? = getOrNull(key)?.asString
|
||||
|
||||
fun JsonObject.getOrNull(key: String) = if (has(key)) get(key) else null
|
||||
}
|
||||
Loading…
Reference in New Issue