Commit a9e06b4bb4998dd8d49719b457f4ac031dcc44c8
Fix crash when voting on a non-msg link
Anders Rune Jensen committed on 4/21/2017, 7:26:06 PMParent: 16d0981db7d404a6b2f805dab96db84bb47597d8
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -271,9 +271,9 @@ | ||
271 | 271 … | cb(null, msg) |
272 | 272 … | } |
273 | 273 … | |
274 | 274 … | function addVoteMessage(msg, cb) { |
275 | - if (msg.value.content.type == 'vote') | |
275 … | + if (msg.value.content.type == 'vote' && msg.value.content.vote.link[0] == '%') | |
276 | 276 … | getMsg(msg.value.content.vote.link, function (err, linkedMsg) { |
277 | 277 … | if (err) return cb(err) |
278 | 278 … | msg.value.content.vote.linkedText = linkedMsg.value.content.text |
279 | 279 … | cb(null, msg) |
Built with git-ssb-web