fix export for gpx files with no attributes

This commit is contained in:
vcoppe
2025-01-25 10:47:47 +01:00
parent 63f3d63518
commit e02a22eaea

View File

@@ -96,7 +96,9 @@ export function buildGPX(file: GPXFile, exclude: string[]): string {
},
});
gpx.attributes.creator = gpx.attributes.creator ?? 'https://gpx.studio';
if (!gpx.attributes)
gpx.attributes = {};
gpx.attributes['creator'] = gpx.attributes['creator'] ?? 'https://gpx.studio';
gpx.attributes['version'] = '1.1';
gpx.attributes['xmlns'] = 'http://www.topografix.com/GPX/1/1';
gpx.attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance';