From 6220aadb2d7210b9ee69f71daa879a48048ddc62 Mon Sep 17 00:00:00 2001
From: Matt Fiddaman <github@m.fiddaman.uk>
Date: Mon, 3 Jun 2024 16:11:02 +0100
Subject: [PATCH] Fix CSV import not matching category is (nothing) rules
 (#2790)

* Fix CSV import not matching category is (nothing) rules

* release note
---
 .../src/components/modals/ImportTransactions.jsx            | 4 +---
 upcoming-release-notes/2790.md                              | 6 ++++++
 2 files changed, 7 insertions(+), 3 deletions(-)
 create mode 100644 upcoming-release-notes/2790.md

diff --git a/packages/desktop-client/src/components/modals/ImportTransactions.jsx b/packages/desktop-client/src/components/modals/ImportTransactions.jsx
index bffda77e0..26abe34e4 100644
--- a/packages/desktop-client/src/components/modals/ImportTransactions.jsx
+++ b/packages/desktop-client/src/components/modals/ImportTransactions.jsx
@@ -941,9 +941,7 @@ export function ImportTransactions({ modalProps, options }) {
       }
 
       const category_id = parseCategoryFields(trans, categories.list);
-      if (category_id != null) {
-        trans.category = category_id;
-      }
+      trans.category = category_id;
 
       const { inflow, outflow, inOut, ...finalTransaction } = trans;
       finalTransactions.push({
diff --git a/upcoming-release-notes/2790.md b/upcoming-release-notes/2790.md
new file mode 100644
index 000000000..72fec3c4f
--- /dev/null
+++ b/upcoming-release-notes/2790.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [matt-fidd]
+---
+
+Fix CSV import not matching category is (nothing) rules
-- 
GitLab