diff --git a/gpx/src/io.ts b/gpx/src/io.ts index 65c074c2..a612c917 100644 --- a/gpx/src/io.ts +++ b/gpx/src/io.ts @@ -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';