Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix useUserStatusMessage exploding on unknown user #7365

Merged
merged 2 commits into from
Dec 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hooks/useUserStatusMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down