From f826bdf13d9bbdfd31a38bfdff382106b8edfd52 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 15 May 2017 09:24:25 -1000 Subject: Don't crash on missing message --- lib/serve.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/serve.js b/lib/serve.js index 54516e1..c70fcac 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -752,7 +752,8 @@ Serve.prototype.id = function (id, ext) { if (self.query.raw != null) return self.rawId(id) this.app.getMsgDecrypted(id, function (err, rootMsg) { - if (err && err.name === 'NotFoundError') err = null, rootMsg = {key: id} + if (err && err.name === 'NotFoundError') err = null, rootMsg = { + key: id, value: {content: false}} if (err) return self.respond(500, err.stack || err) var rootContent = rootMsg && rootMsg.value && rootMsg.value.content var recps = rootContent && rootContent.recps -- cgit v1.2.3