findAccountByUsername: safely check account?.acct

This commit is contained in:
Alex Gleason
2022-08-31 10:18:13 -05:00
parent b7abb11ca2
commit b67c454144

View File

@ -59,7 +59,7 @@ const findAccountsByUsername = (state: RootState, username: string) => {
const accounts = state.accounts;
return accounts.filter(account => {
return username.toLowerCase() === account.acct.toLowerCase();
return username.toLowerCase() === account?.acct.toLowerCase();
});
};