From caa80bc1dbe5bebd6b4ebbb8a60f66c4cbbb3b2c Mon Sep 17 00:00:00 2001 From: Ivo Julca Date: Sun, 20 Dec 2015 04:54:44 -0500 Subject: [PATCH] Traditional Games: fix possible crash in request --- chat-plugins/traditionalgames.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chat-plugins/traditionalgames.js b/chat-plugins/traditionalgames.js index 90ae80f8aa..c9c9a56758 100644 --- a/chat-plugins/traditionalgames.js +++ b/chat-plugins/traditionalgames.js @@ -28,7 +28,7 @@ function wikiaSearch(subdomain, query, callback) { return callback(null, result.items[0]); }); - }); + }).on('error', callback); } exports.commands = { @@ -56,6 +56,6 @@ exports.commands = { let htmlReply = "Best result for " + Tools.escapeHTML(query) + ":
" + Tools.escapeHTML(entryTitle) + ""; if (!broadcasting) return connection.sendTo(room, "|raw|
" + htmlReply + "
"); room.addRaw("
" + htmlReply + "
").update(); - }); + }.once()); } };