Added exception handling in MapFragment

This commit is contained in:
Pau 2025-05-22 20:51:33 +02:00
parent 4c189a0724
commit ef9092467f
1 changed files with 3 additions and 1 deletions

View File

@ -446,7 +446,9 @@ public class MapFragment extends Fragment {
showPlaceBottomSheet(closestPlace); showPlaceBottomSheet(closestPlace);
} else { } else {
// No close places found // No close places found
Helper.makeSnackBar(rlMap, "No places found near this location"); if (isAdded() && getContext() != null) {
Helper.makeSnackBar(rlMap, "No places found near this location");
}
} }
} else { } else {
Helper.makeSnackBar(rlMap, "Location not found"); Helper.makeSnackBar(rlMap, "Location not found");