From 9f3ea0581a235ee4e66a7b550999059a21eab442 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 2 Jan 2023 21:19:01 +0100 Subject: [PATCH] Use 'useIfNoUnitSet' as 'defaultUnit' again --- Models/Unit.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Models/Unit.ts b/Models/Unit.ts index 90661ecc94..e6ab43a4e7 100644 --- a/Models/Unit.ts +++ b/Models/Unit.ts @@ -116,7 +116,9 @@ export class Unit { (u, i) => new Denomination( u, - u.canonicalDenomination.trim() === json.defaultInput, + u.canonicalDenomination === undefined + ? undefined + : u.canonicalDenomination.trim() === json.defaultInput, `${ctx}.units[${i}]` ) )