lib/client: gracefully handle null in isMyNick/isChannel
This commit is contained in:
parent
0705f4b182
commit
41354d3035
1 changed files with 6 additions and 0 deletions
|
@ -477,10 +477,16 @@ export default class Client extends EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
isMyNick(nick) {
|
isMyNick(nick) {
|
||||||
|
if (!nick) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return this.cm(nick) == this.cm(this.nick);
|
return this.cm(nick) == this.cm(this.nick);
|
||||||
}
|
}
|
||||||
|
|
||||||
isChannel(name) {
|
isChannel(name) {
|
||||||
|
if (!name) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
var chanTypes = this.isupport.get("CHANTYPES") || irc.STD_CHANTYPES;
|
var chanTypes = this.isupport.get("CHANTYPES") || irc.STD_CHANTYPES;
|
||||||
return chanTypes.indexOf(name[0]) >= 0;
|
return chanTypes.indexOf(name[0]) >= 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue