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;