mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-27 19:44:50 -05:00
Traditional Games: fix possible crash in request
This commit is contained in:
@@ -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 = "<strong>Best result for " + Tools.escapeHTML(query) + ":</strong><br/><a href=\"" + Tools.escapeHTML(entryUrl) + "\">" + Tools.escapeHTML(entryTitle) + "</a>";
|
||||
if (!broadcasting) return connection.sendTo(room, "|raw|<div class=\"infobox\">" + htmlReply + "</div>");
|
||||
room.addRaw("<div class=\"infobox\">" + htmlReply + "</div>").update();
|
||||
});
|
||||
}.once());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user