Merge pull request #2849 from thelounge/xpaw/webirc-ownprop

Use hasOwnProperty when checking for webirc
This commit is contained in:
Pavel Djundik 2018-10-13 13:11:57 +03:00 committed by GitHub
commit 010ddab78e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}