From 6f40e2afcea954c4adc8feb206aaf1ebc76c05ba Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 20 Aug 2018 19:01:03 -0700 Subject: Handle empty git-ssb commit object Missing sha1 for commit with empty body fixed in %MhqXtikUPC56S9M4uzSGMYtuGNh/iFPDUoggDtWZVEE=.sha256 --- lib/render-msg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/render-msg.js b/lib/render-msg.js index cff8f29..c0de668 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -754,9 +754,9 @@ RenderMsg.prototype.gitUpdate = function (cb) { h('ul', self.c.commits.map(function (commit) { var path = '/git/commit/' + encodeURIComponent(commit.sha1) + '?msg=' + encodeURIComponent(self.msg.key) - return h('li', h('a', {href: self.render.toUrl(path)}, - h('code', String(commit.sha1).substr(0, 8))), ' ', - self.linkify(String(commit.title)), + return h('li', commit.sha1 ? [h('a', {href: self.render.toUrl(path)}, + h('code', String(commit.sha1).substr(0, 8))), ' '] : '', + commit.title ? self.linkify(String(commit.title)) : '', self.render.gitCommitBody(commit.body) ) })) : '', -- cgit v1.2.3