From 2eeceb84feb0cb5b9cc07a93e2b8b47fc3d313a7 Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:46:10 -0600 Subject: [PATCH] fix: fixed GEO missing when supplied (closes #569) --- src/event.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/event.ts b/src/event.ts index cecb092ed..1248006e6 100755 --- a/src/event.ts +++ b/src/event.ts @@ -918,7 +918,7 @@ export default class ICalEvent { return this; } if ( - (location && !location.title) || + (!location?.title &&& !location?.geo) || (location?.geo && (!isFinite(location.geo.lat) || !isFinite(location.geo.lon))) ) { throw new Error( @@ -1766,13 +1766,14 @@ export default class ICalEvent { ':geo:' + escape(this.data.location.geo?.lat, false) + ',' + escape(this.data.location.geo?.lon, false) + '\r\n'; } - - if (this.data.location.geo) { - g += 'GEO:' + escape(this.data.location.geo?.lat, false) + ';' + - escape(this.data.location.geo?.lon, false) + '\r\n'; - } } + // GEO + if (this.data.location.geo) { + g += 'GEO:' + escape(this.data.location.geo?.lat, false) + ';' + + escape(this.data.location.geo?.lon, false) + '\r\n'; + } + // DESCRIPTION if (this.data.description) { g += 'DESCRIPTION:' + escape(this.data.description.plain, false) + '\r\n';