lib/client: gracefully handle null in isMyNick/isChannel

This commit is contained in:
Simon Ser 2021-06-10 08:51:59 +02:00
parent 0705f4b182
commit 41354d3035

View file

@ -477,10 +477,16 @@ export default class Client extends EventTarget {
}
isMyNick(nick) {
if (!nick) {
return false;
}
return this.cm(nick) == this.cm(this.nick);
}
isChannel(name) {
if (!name) {
return false;
}
var chanTypes = this.isupport.get("CHANTYPES") || irc.STD_CHANTYPES;
return chanTypes.indexOf(name[0]) >= 0;
}