Permalink
Browse files

Merge pull request #318 from jagerman/telegram-report-crash

Fix telegram crash when requesting report for invalid addr
  • Loading branch information...
dvandal committed Aug 17, 2018
2 parents 1a62930 + b2ca68e commit 939021cdd93257fac8b3876fef7bfdc6a95cd273
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/telegramBot.js
View
@@ -178,7 +178,10 @@ function sendMinerStats(telegramMsg, address) {
apiInterfaces.pool('/stats_address?address='+address, function(error, data) {
if (error || !data) {
log('error', logSystem, 'Unable to get API data for miner stats: ' + error);
return bot.sendMessage(id, 'Unable to get miner statistics. Please retry.');
return bot.sendMessage(telegramMsg.from.id, 'Unable to get miner statistics. Please retry.');
}
if (!data.stats) {
return bot.sendMessage(telegramMsg.from.id, 'No miner statistics found for that address. Please check the address and try again.');
}
var minerHashrate = utils.getReadableHashRate(data.stats.hashrate);

0 comments on commit 939021c

Please sign in to comment.