Guard setCurrentViewingUser against undefined from find()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 14:10:24 +08:00
parent 1ac3d7cd5b
commit 36613d255b

View File

@@ -74,6 +74,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
*/
setCurrentViewingUser(username: string) {
const userFind = this.allUserAccountList.find(user => user.username === username);
if (!userFind) return;
this.currentViewingUser = userFind;
},
/**