[android] fix crash on bookmark when pp is closing

Signed-off-by: Arnaud Vergnet <arnaud.vergnet@mailo.com>
This commit is contained in:
Arnaud Vergnet 2023-06-17 10:30:52 +02:00 committed by Alexander Borsuk
parent f2abf143f1
commit c19f9bc315

View file

@ -402,6 +402,10 @@ public class PlacePageController extends Fragment implements
private void onBookmarkBtnClicked()
{
// mMapObject is set to null when the place page closes
// We don't want users to interact with the buttons when the PP is closing
if (mMapObject == null)
return;
// No need to call setMapObject here as the native methods will reopen the place page
if (MapObject.isOfType(MapObject.BOOKMARK, mMapObject))
Framework.nativeDeleteBookmarkFromMapObject();
@ -490,7 +494,8 @@ public class PlacePageController extends Fragment implements
private void onAvoidBtnClicked(@NonNull RoadType roadType)
{
mPlacePageRouteSettingsListener.onPlacePageRequestToggleRouteSettings(roadType);
if (mMapObject != null)
mPlacePageRouteSettingsListener.onPlacePageRequestToggleRouteSettings(roadType);
}
private void removePlacePageFragments()