From 6d463334a5344a1620e3b27f5b1cdaad8d50c1fd Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 24 May 2020 10:46:50 -0700 Subject: [PATCH] fix autobug racecondition that could occur with non gps devices --- app/src/main/java/com/geeksville/mesh/service/MeshService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 1d50bf78..0c3f30db 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -875,7 +875,8 @@ class MeshService : Service(), Logging { updateNotification() // we don't ask for GPS locations from android if our device has a built in GPS - if (!myNodeInfo!!.hasGPS) { + // Note: myNodeInfo can go away if we lose connections, so it might be null + if (myNodeInfo?.hasGPS != true) { // If we have at least one other person in the mesh, send our GPS position otherwise stop listening to GPS serviceScope.handledLaunch(Dispatchers.Main) {