From c179f96145ef1cf7270324717d0ead6348fbc17f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 10 Dec 2024 17:16:17 +0200 Subject: [PATCH] Try to fix #21553 (#21554) --- .../kotlin/net/osmand/shared/gpx/RouteActivityHelper.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/RouteActivityHelper.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/RouteActivityHelper.kt index be00343dc93..0cc947be854 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/RouteActivityHelper.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/RouteActivityHelper.kt @@ -49,8 +49,11 @@ object RouteActivityHelper { runAsync { trackItems.forEach { trackItem -> trackItem.getFile()?.let { file -> - val gpxFile = PlatformUtil.getOsmAndContext().getSelectedFileByPath(file.absolutePath()) - if (gpxFile != null && gpxFile.error == null) { + var gpxFile = PlatformUtil.getOsmAndContext().getSelectedFileByPath(file.absolutePath()) + if (gpxFile == null) { + gpxFile = GpxUtilities.loadGpxFile(file) + } + if (gpxFile.error == null) { saveRouteActivityAsync(gpxFile, routeActivity) } }