From 44d2b4b0e1433a9c9d982e8506c3a82a4c8d65c0 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:41:21 -0300 Subject: [PATCH] [FIX] makeThreadName asserting undefined as non-null (#3628) --- app/utils/room.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/room.ts b/app/utils/room.ts index 3e4e0ef44..d39e40490 100644 --- a/app/utils/room.ts +++ b/app/utils/room.ts @@ -60,6 +60,6 @@ export const getBadgeColor = ({ }; export const makeThreadName = (messageRecord: { id?: string; msg?: string; attachments?: IAttachment[] }): string | undefined => - messageRecord.msg || messageRecord.attachments![0].title; + messageRecord.msg || messageRecord?.attachments?.[0]?.title; export const isTeamRoom = ({ teamId, joined }: { teamId: string; joined: boolean }): boolean => !!teamId && joined;