From 210a9e2b97615ebe90598d6ece181d77bfeec7e5 Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Thu, 26 Sep 2024 14:15:09 +0300 Subject: [PATCH] Small improvement --- .../src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt index 01fdfe599f3..25bd7f59dd4 100644 --- a/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt +++ b/OsmAnd-shared/src/commonMain/kotlin/net/osmand/shared/gpx/GpxUtilities.kt @@ -414,8 +414,8 @@ object GpxUtilities { fun writeGpxFile(file: KFile, gpxFile: GpxFile): KException? { return try { + file.getParentFile()?.createDirectories() if (KAlgorithms.isEmpty(gpxFile.path)) { - file.getParentFile()?.createDirectories() gpxFile.path = if (file.isAbsolute()) file.path() else file.absolutePath() } writeGpx(file, null, gpxFile, null)