From 619b64e0e9820cd82a371e0cf49ebb6304af6d56 Mon Sep 17 00:00:00 2001 From: DevarshVasani Date: Wed, 5 Mar 2025 17:24:30 +0530 Subject: [PATCH] Fix IllegalStateException in destroySurface method Signed-off-by: DevarshVasani --- android/app/src/main/java/app/organicmaps/MapFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/app/organicmaps/MapFragment.java b/android/app/src/main/java/app/organicmaps/MapFragment.java index 958aa564f2..99a50d7a87 100644 --- a/android/app/src/main/java/app/organicmaps/MapFragment.java +++ b/android/app/src/main/java/app/organicmaps/MapFragment.java @@ -43,7 +43,8 @@ public class MapFragment extends BaseMwmFragment implements View.OnTouchListener public void destroySurface() { - mMap.onSurfaceDestroyed(requireActivity().isChangingConfigurations(), isAdded()); + if (getActivity() != null) + mMap.onSurfaceDestroyed(getActivity().isChangingConfigurations(), isAdded()); } public boolean isContextCreated()