diff --git a/gpx/src/gpx.ts b/gpx/src/gpx.ts index 4aba2a35a..426d99315 100644 --- a/gpx/src/gpx.ts +++ b/gpx/src/gpx.ts @@ -17,6 +17,9 @@ import { import { immerable, isDraft, original, freeze } from 'immer'; function cloneJSON(obj: T): T { + if (obj === undefined) { + return undefined; + } if (obj === null || typeof obj !== 'object') { return null; }