Skip to content

Commit

Permalink
fix: check gocardless bank data before setting state
Browse files Browse the repository at this point in the history
  • Loading branch information
thraizz committed Nov 5, 2024
1 parent c0f9073 commit 870164c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 870164c

Please sign in to comment.