From 554a9e995b21d78f5c902f6e9f077161abe313dd Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 20 Apr 2018 21:01:11 +0000 Subject: [PATCH] do not fail broken regex --- modules/kill_namespam/kill_namespam.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/kill_namespam/kill_namespam.js b/modules/kill_namespam/kill_namespam.js index 635c39b..7bede0a 100644 --- a/modules/kill_namespam/kill_namespam.js +++ b/modules/kill_namespam/kill_namespam.js @@ -16,7 +16,8 @@ var kill_namespam = function(dbot) { // Here we listen for atropos if(event.channel == this.config.cliconn_channel) { if(event.message.match('▶')) { - var matchedPattern = _.find(this.config.cliconn_patterns, function(p) { return event.message.match(p); }) + var matchedPattern = _.find(this.config.cliconn_patterns, + function(p) { try { return event.message.match(p); } catch(e) {}; }); // ok.jpg if(matchedPattern) { var ip = event.message.split(' ')[1]