From 60ed69746020ae37b9669fed75e5d178186439b3 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 16 Apr 2020 17:17:40 +0200 Subject: [PATCH] Add comment when tx is undefined We createContributionFor() simply returns if no contributor is found. --- integrations/zoom.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/integrations/zoom.js b/integrations/zoom.js index a5c2cb0..7968ff3 100644 --- a/integrations/zoom.js +++ b/integrations/zoom.js @@ -74,12 +74,11 @@ module.exports = async function(robot, kredits) { } const names = Array.from(new Set(participants.map(p => p.name))); for(const displayName of names) { - await createContributionFor(displayName, meetingDetails) - .then(tx => { - if (tx) { - robot.logger.info(`[hubot-kredits] Contribution created: ${tx.hash}`); - } - }); + const tx = createContributionFor(displayName, meetingDetails) + // if the contributor is not found we do not get a transaction object here + if (tx) { + robot.logger.info(`[hubot-kredits] Contribution created: ${tx.hash}`); + } }; }