From 2df09406e1c3f48396f212fa54cbf4e1661d2b35 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 3 Feb 2021 15:04:07 +0300 Subject: [PATCH] Fix npe --- OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java index 4b58c0b9dc..260730c101 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java @@ -1130,7 +1130,9 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card if (mapActivity != null) { OsmandApplication app = mapActivity.getMyApplication(); SelectedGpxFile selectedGpxFile = app.getSelectedGpxHelper().selectGpxFile(result, true, false); - showInstance(mapActivity, selectedGpxFile, null); + if (selectedGpxFile != null) { + showInstance(mapActivity, selectedGpxFile, null); + } } if (progress != null && AndroidUtils.isActivityNotDestroyed(mapActivity)) { progress.dismiss(); @@ -1142,7 +1144,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card } } - public static boolean showInstance(@NonNull MapActivity mapActivity, SelectedGpxFile selectedGpxFile, @Nullable LatLon latLon) { + public static boolean showInstance(@NonNull MapActivity mapActivity, @NonNull SelectedGpxFile selectedGpxFile, @Nullable LatLon latLon) { try { Bundle args = new Bundle(); args.putInt(ContextMenuFragment.MENU_STATE_KEY, MenuState.HEADER_ONLY);