diff --git a/android/app/src/main/java/rs/rhema/phone/sensors/PhoneSensors.kt b/android/app/src/main/java/rs/rhema/phone/sensors/PhoneSensors.kt index a3ccf61..2a9f5c9 100644 --- a/android/app/src/main/java/rs/rhema/phone/sensors/PhoneSensors.kt +++ b/android/app/src/main/java/rs/rhema/phone/sensors/PhoneSensors.kt @@ -113,7 +113,11 @@ object PhoneSensors { settled.set(true) signal.cancel() } - val callback = androidx.core.util.Consumer { location -> + // The parameter is nullable on purpose: the provider + // calls this with null when it has no fix. Typed + // non-null, Kotlin's parameter check threw on the main + // thread before this body ran, killing the process. + val callback = androidx.core.util.Consumer { location -> // The timeout abandons this coroutine but not the // callback: a late answer must not resume it twice. // A null answer is the provider's "no fix", which