Skip to content

Commit

Permalink
🐛 fix condition "notes contains (nothing)" throwing error (#3943)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis authored Dec 9, 2024
1 parent d649eec commit a289227
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/loot-core/src/server/accounts/transaction-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ export async function runRules(trans) {
return await finalizeTransactionForRules(finalTrans);
}

function conditionSpecialCases(cond: Condition): Condition {
function conditionSpecialCases(cond: Condition | null): Condition | null {
if (!cond) {
return cond;
}

//special cases that require multiple conditions
if (cond.op === 'is' && cond.field === 'category' && cond.value === null) {
return new Condition(
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3943.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatissJanis]
---

Fix rule creation throwing error for "notes contains (nothing)" condition.

0 comments on commit a289227

Please sign in to comment.