From ceee85fcc6a473ba515fa2822d4650e79053329e Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Tue, 17 Dec 2024 23:01:12 +0100 Subject: [PATCH] fix: notes is (nothing) not working --- packages/loot-core/src/server/accounts/rules.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/loot-core/src/server/accounts/rules.ts b/packages/loot-core/src/server/accounts/rules.ts index 449590370fb..b140819fffb 100644 --- a/packages/loot-core/src/server/accounts/rules.ts +++ b/packages/loot-core/src/server/accounts/rules.ts @@ -360,6 +360,12 @@ export class Condition { eval(object) { let fieldValue = object[this.field]; + const type = this.type; + + if (type === 'string') { + fieldValue ??= ''; + } + if (fieldValue === undefined) { return false; } @@ -368,8 +374,6 @@ export class Condition { fieldValue = fieldValue.toLowerCase(); } - const type = this.type; - if (type === 'number' && this.options) { if (this.options.outflow) { if (fieldValue > 0) {