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
@ -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 New Issue
Block a user