From 04f25e0650791a8626ab18c87497f61e9dd6b6b2 Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Tue, 3 Jul 2018 12:11:26 +0200 Subject: [PATCH] tip-kudos-recipients: Fix error while parsing kudos --- bot_scripts/check-bot-balance.js | 2 +- bot_scripts/tip-kudos-recipients.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bot_scripts/check-bot-balance.js b/bot_scripts/check-bot-balance.js index 18b7068..6fea888 100644 --- a/bot_scripts/check-bot-balance.js +++ b/bot_scripts/check-bot-balance.js @@ -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 } diff --git a/bot_scripts/tip-kudos-recipients.js b/bot_scripts/tip-kudos-recipients.js index 27e46f0..8f82dae 100644 --- a/bot_scripts/tip-kudos-recipients.js +++ b/bot_scripts/tip-kudos-recipients.js @@ -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 }