Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix TitleNotifier crash (#3100)

janWilejan8578c3e56a66
diff --git a/web/components/TitleNotifier/TitleNotifier.tsx b/web/components/TitleNotifier/TitleNotifier.tsx
index dfffcc5b81..a6f3dce62b 100644
--- a/web/components/TitleNotifier/TitleNotifier.tsx
+++ b/web/components/TitleNotifier/TitleNotifier.tsx
@@ -58,8 +58,8 @@ export const TitleNotifier: FC<TitleNotifierProps> = ({ name }) => {
}
// Only alert on real chat messages from people.
- const lastMessage = chatMessages[chatMessages.length - 1];
- if (lastMessage.type !== 'CHAT') {
+ const lastMessage = chatMessages.at(-1);
+ if (!lastMessage || lastMessage.type !== 'CHAT') {
return;
}