Skip to content

A local-first personal finance app

fix: check gocardless bank data before setting state (#3793)

A. Schueler8eafa1e741bc
diff --git a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
index 37d4913f22..d2b3730d5a 100644
--- a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
+++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
@@ -42,7 +42,7 @@ function useAvailableBanks(country: string) {
const { data, error } = await sendCatch('gocardless-get-banks', country);
- if (error) {
+ if (error || !Array.isArray(data)) {
setIsError(true);
setBanks([]);
} else {
diff --git a/upcoming-release-notes/3793.md b/upcoming-release-notes/3793.md
new file mode 100644
index 0000000000..ee9ad3ea9d
--- /dev/null
+++ b/upcoming-release-notes/3793.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [thraizz]
+---
+
+Handle unexpected response from GoCardless when getting banks.