lib/irc: fix bound check in isHighlight

Doesn't seem like this was causing any issues, but let's fix the
logic regardless.
This commit is contained in:
Simon Ser 2022-02-25 11:38:00 +01:00
parent 221b1b6356
commit e37d5f363b

View File

@ -298,7 +298,7 @@ export function isHighlight(msg, nick, cm) {
if (i > 0) {
left = text[i - 1];
}
if (i < text.length) {
if (i + nick.length < text.length) {
right = text[i + nick.length];
}
if (isWordBoundary(left) && isWordBoundary(right)) {