aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-15 09:24:25 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-15 09:24:25 -1000
commitf826bdf13d9bbdfd31a38bfdff382106b8edfd52 (patch)
tree72c7717f91071c5a5220fe6335a892bcc7d64701
parent24417ffb7f896971664053a13101154e40d6adce (diff)
downloadpatchfoo-f826bdf13d9bbdfd31a38bfdff382106b8edfd52.tar.gz
patchfoo-f826bdf13d9bbdfd31a38bfdff382106b8edfd52.zip
Don't crash on missing message
-rw-r--r--lib/serve.js3
1 files changed, 2 insertions, 1 deletions
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