From 9686c0383ec2d49b6d275194b7a8f0ce5c6693a2 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 13 Oct 2018 12:54:46 +0300 Subject: [PATCH] Use hasOwnProperty when checking for webirc --- src/models/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/network.js b/src/models/network.js index a89dc59e..0bf59524 100644 --- a/src/models/network.js +++ b/src/models/network.js @@ -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); }