commit 22d5bdb924830d378b9eaaf08a866f2f3733c534 Author: Fabio Mazza Date: Thu May 14 12:18:25 2026 +0200 Surround with try catch so that the app doesn't crash (it's useless) diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/MapLibreFragment.kt b/app/src/main/java/it/reyboz/bustorino/fragments/MapLibreFragment.kt index 87bcd09..eea90d9 100644 --- a/app/src/main/java/it/reyboz/bustorino/fragments/MapLibreFragment.kt +++ b/app/src/main/java/it/reyboz/bustorino/fragments/MapLibreFragment.kt @@ -471,11 +471,15 @@ class MapLibreFragment : GeneralMapLibreFragment() { //if map is initialized mapStateViewModel.saveMapState(it) } - //save last location - map?.locationComponent?.let{ - if(locationInitialized && it.isLocationComponentActivated){ - stopsViewModel.lastUserLocation = it.lastKnownLocation + try{ + //save last location + map?.locationComponent?.let{ + if(locationInitialized && it.isLocationComponentActivated){ + stopsViewModel.lastUserLocation = it.lastKnownLocation + } } + }catch (e: Exception){ + Log.w(DEBUG_TAG, "Cannot save lastKnowLocation from map location component,error: ${e.message}") } mapStateViewModel.lastOpenStopID.postValue(shownStopInBottomSheet?.ID) if (livePositionsViewModel.useMQTTPositionsLiveData.value!!) livePositionsViewModel.stopMatoUpdates()