From 8923da7bf74b404af4ce53e12ebbbc334503a9af Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 20 Dec 2021 13:51:48 +0000 Subject: [PATCH] [Release] Fix useUserStatusMessage exploding on unknown user (#7419) https://github.com/matrix-org/matrix-react-sdk/pull/7365 to release --- src/hooks/useUserStatusMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useUserStatusMessage.ts b/src/hooks/useUserStatusMessage.ts index ca2dbbf6e8..c3c99dc668 100644 --- a/src/hooks/useUserStatusMessage.ts +++ b/src/hooks/useUserStatusMessage.ts @@ -25,7 +25,7 @@ import { useFeatureEnabled } from "./useSettings"; const getUser = (cli: MatrixClient, user: Member): User => cli.getUser(user?.userId); 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