diff --git a/src/stores/acctMgmt.ts b/src/stores/acctMgmt.ts index 0ff21ae..5020f37 100644 --- a/src/stores/acctMgmt.ts +++ b/src/stores/acctMgmt.ts @@ -267,7 +267,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', { try { const response = await apiClient.get(apiUserDetail); this.currentViewingUser = response.data; - this.currentViewingUser.is_admin = response.data.roles.some(role => role.code === 'admin'); + this.currentViewingUser.is_admin = response.data.roles?.some(role => role.code === 'admin') ?? false; return response.status === 200; } catch (error) { // No need to show an error, because an error here means the account is unique