Use hasOwnProperty when checking for webirc

This commit is contained in:
Pavel Djundik 2018-10-13 12:54:46 +03:00
parent a6a2336a6f
commit 9686c0383e

View file

@ -139,7 +139,7 @@ Network.prototype.createIrcFramework = function(client) {
};
Network.prototype.createWebIrc = function(client) {
if (!Helper.config.webirc || !(this.host in Helper.config.webirc)) {
if (!Helper.config.webirc || !Helper.config.webirc.hasOwnProperty(this.host)) {
return null;
}
@ -153,7 +153,7 @@ Network.prototype.createWebIrc = function(client) {
this.hostname = this.ip;
}
if (Helper.config.webirc[this.host] instanceof Function) {
if (typeof Helper.config.webirc[this.host] === "function") {
return Helper.config.webirc[this.host](client, this);
}