[Release] Fix useUserStatusMessage exploding on unknown user (#7419)

https://github.com/matrix-org/matrix-react-sdk/pull/7365 to release
This commit is contained in:
Michael Telatynski 2021-12-20 13:51:48 +00:00 committed by GitHub
parent d10ac7cfdb
commit 8923da7bf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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