Merge pull request #11094 from osmandapp/FixGpxInfoCrash

Fix "Crash when add waypoint to current recording gpx track"
This commit is contained in:
Vitaliy 2021-03-09 18:15:18 +02:00 committed by GitHub
commit b65b4dac81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -737,7 +737,9 @@ public class GpxSelectionHelper {
String rootGpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath() + '/';
String fileName = path.replace(rootGpxDir, "");
GPXInfo gpxInfo = GpxUiHelper.getGpxInfoByFileName(app, fileName);
SearchHistoryHelper.getInstance(app).addNewItemToHistory(gpxInfo);
if (gpxInfo != null) {
SearchHistoryHelper.getInstance(app).addNewItemToHistory(gpxInfo);
}
}
return sf;
}