fix js crash

This commit is contained in:
Luke Slater 2012-11-20 16:49:37 +00:00
parent 53103c6842
commit 96b2dd0ddd

View File

@ -13,9 +13,11 @@ var js = function(dbot) {
var commands = { var commands = {
// Run JS code sandboxed, return result to channel. // Run JS code sandboxed, return result to channel.
'~js': function(event) { '~js': function(event) {
s.run(event.input[1], function(output) { try {
event.reply(output.result); s.run(event.input[1], function(output) {
}.bind(this)); event.reply(output.result);
}.bind(this));
} catch(err) {}
}, },
// Run JS code un-sandboxed, with access to DBot memory (admin-only). // Run JS code un-sandboxed, with access to DBot memory (admin-only).