fix: prevent "cannot read properties of undefined (reading 'map')" crash (#532)

This commit is contained in:
paisley
2026-03-16 19:52:01 +08:00
committed by GitHub
parent 925fbab86d
commit 11e28a2cfa
6 changed files with 23 additions and 20 deletions

View File

@@ -82,10 +82,10 @@ export const useProviderStore = create<ProviderState>((set, get) => ({
const snapshot = await fetchProviderSnapshot();
set({
statuses: snapshot.statuses,
accounts: snapshot.accounts,
vendors: snapshot.vendors,
defaultAccountId: snapshot.defaultAccountId,
statuses: snapshot.statuses ?? [],
accounts: snapshot.accounts ?? [],
vendors: snapshot.vendors ?? [],
defaultAccountId: snapshot.defaultAccountId ?? null,
loading: false
});
} catch (error) {