diff options
-rw-r--r-- | lib/app.js | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -491,13 +491,17 @@ function getMsgWithValue(sbot, id, cb) { var parts = id.split('?unbox=') id = parts[0] var unbox = parts[1] && parts[1].replace(/ /g, '+') - sbotGet(sbot, id, function (err, value) { - if (err) return cb(err) - var msg = {key: id, value: value} - if (unbox && value && typeof value.content === 'string') - return self.app.unboxMsgWithKey(msg, unbox, cb) - cb(null, msg) - }) + try { + sbotGet(sbot, id, function (err, value) { + if (err) return cb(err) + var msg = {key: id, value: value} + if (unbox && value && typeof value.content === 'string') + return self.app.unboxMsgWithKey(msg, unbox, cb) + cb(null, msg) + }) + } catch(e) { + return cb(e) + } } App.prototype._getAbout = function (id, cb) { |