From 0733c46fcbf5a0b1cbdd5708db05d669614e688e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 26 Dec 2023 12:35:51 +0100 Subject: [PATCH] Fix undefined error in DirectionIndicator --- src/Logic/GeoOperations.ts | 3 +++ src/UI/Base/DirectionIndicator.svelte | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Logic/GeoOperations.ts b/src/Logic/GeoOperations.ts index 14ce8c85b..00d664da5 100644 --- a/src/Logic/GeoOperations.ts +++ b/src/Logic/GeoOperations.ts @@ -994,6 +994,9 @@ export class GeoOperations { * @param meters */ public static distanceToHuman(meters: number): string { + if (meters === undefined) { + return "" + } meters = Math.round(meters) if (meters < 1000) { return meters + "m" diff --git a/src/UI/Base/DirectionIndicator.svelte b/src/UI/Base/DirectionIndicator.svelte index 27b6b6d7f..b4225aac6 100644 --- a/src/UI/Base/DirectionIndicator.svelte +++ b/src/UI/Base/DirectionIndicator.svelte @@ -109,7 +109,7 @@