diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-15 09:24:25 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-05-15 09:24:25 -1000 |
commit | f826bdf13d9bbdfd31a38bfdff382106b8edfd52 (patch) | |
tree | 72c7717f91071c5a5220fe6335a892bcc7d64701 /lib | |
parent | 24417ffb7f896971664053a13101154e40d6adce (diff) | |
download | patchfoo-f826bdf13d9bbdfd31a38bfdff382106b8edfd52.tar.gz patchfoo-f826bdf13d9bbdfd31a38bfdff382106b8edfd52.zip |
Don't crash on missing message
Diffstat (limited to 'lib')
-rw-r--r-- | lib/serve.js | 3 |
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 |