From 037b18e2cbab0b2c77b5d528229a6236909b5e99 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 14 Dec 2021 15:11:55 +0000 Subject: [PATCH] Fix useUserStatusMessage exploding on unknown user --- 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 ca2dbbf6e87..c3c99dc6685 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