Fix useUserStatusMessage exploding on unknown user (#7365)

pull/21833/head
Michael Telatynski 2021-12-14 16:07:34 +00:00 committed by GitHub
parent 1d9906c3fa
commit c1315bfa6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ import { useFeatureEnabled } from "./useSettings";
const getUser = (cli: MatrixClient, user: Member): User => cli.getUser(user?.userId); const getUser = (cli: MatrixClient, user: Member): User => cli.getUser(user?.userId);
const getStatusMessage = (cli: MatrixClient, user: Member): string => { const getStatusMessage = (cli: MatrixClient, user: Member): string => {
return getUser(cli, user).unstable_statusMessage; return getUser(cli, user)?.unstable_statusMessage;
}; };
// Hook to simplify handling Matrix User status // Hook to simplify handling Matrix User status