diff --git a/app/src/main/java/com/github/se/travelpouch/model/activity/map/DirectionsViewModel.kt b/app/src/main/java/com/github/se/travelpouch/model/activity/map/DirectionsViewModel.kt index c400e854d..44ac7a996 100644 --- a/app/src/main/java/com/github/se/travelpouch/model/activity/map/DirectionsViewModel.kt +++ b/app/src/main/java/com/github/se/travelpouch/model/activity/map/DirectionsViewModel.kt @@ -161,10 +161,12 @@ class DirectionsViewModel(private val repository: DirectionsRepositoryInterface) targetStateFlow.value = routeDetails } else { Log.e("DirectionsViewModel", "Failed to extract route details") + targetStateFlow.value = RouteDetails.EMPTY } }, onFailure = { exception -> Log.e("DirectionsViewModel", "Failed to fetch directions", exception) + targetStateFlow.value = RouteDetails.EMPTY }) } }