Commit c201e35b8d6663a0a4e9ea13a1a5b0d465d3b9d5
Better error handling for malformed vote messages
Anders Rune Jensen committed on 4/25/2018, 1:58:23 PMParent: e525414d1f2edc4363b7e94b7b4da1252e853026
Files changed
index.js | changed |
index.js | |||
---|---|---|---|
@@ -355,9 +355,9 @@ | |||
355 | 355 … | cb(null, msg) | |
356 | 356 … | } | |
357 | 357 … | ||
358 | 358 … | function addVoteMessage(msg, cb) { | |
359 | - if (msg.value.content.type == 'vote' && msg.value.content.vote.link[0] == '%') | ||
359 … | + if (msg.value.content.type == 'vote' && msg.value.content.vote && msg.value.content.vote.link[0] == '%') | ||
360 | 360 … | getMsg(msg.value.content.vote.link, function (err, linkedMsg) { | |
361 | 361 … | if (linkedMsg) | |
362 | 362 … | msg.value.content.vote.linkedText = linkedMsg.value.content.text | |
363 | 363 … | cb(null, msg) |
Built with git-ssb-web