mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 21:59:43 +03:00
fix TitleNotifier crash (#3100)
rare chance of crashing when using ReactRefresh with an empty chat Co-authored-by: janWilejan <>
This commit is contained in:
parent
990b720611
commit
e752934fd5
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue