tip-kudos-recipients: Fix error while parsing kudos

This commit is contained in:
Pedro Pombeiro 2018-07-03 12:11:26 +02:00
parent a6e779cae0
commit 04f25e0650
2 changed files with 6 additions and 2 deletions

View File

@ -21,7 +21,7 @@ var isCheckingBalance = false
module.exports = robot => {
if (!options || !options.accounts || options.accounts.length === 0) {
robot.log.debug(`${botName} - No accounts counfigured. Disabling script`)
robot.log.debug(`${botName} - No accounts configured. Disabling script`)
return
}

View File

@ -32,6 +32,10 @@ var isCheckingUpdates = false
var previousNonce = null
module.exports = robot => {
if (!options || !token) {
robot.log.debug(`${botName} - No options configured. Disabling script`)
return
}
if (!privateKey.startsWith('0x')) {
robot.log.error(`${botName} - Private key must start with 0x. Disabling script`)
return
@ -112,7 +116,7 @@ async function fetchPendingKudos (robot, data) {
// and leave it for a later time, so that people have time to vote
continue
}
if (message.type !== 'message' || message.subtype || !message.bot_id) {
if (message.type !== 'message' || message.subtype || !message.bot_id || !message.attachments) {
continue
}