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.
|
// Only alert on real chat messages from people.
|
||||||
const lastMessage = chatMessages[chatMessages.length - 1];
|
const lastMessage = chatMessages.at(-1);
|
||||||
if (lastMessage.type !== 'CHAT') {
|
if (!lastMessage || lastMessage.type !== 'CHAT') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user