Add comment when tx is undefined

We createContributionFor() simply returns if no contributor is found.
This commit is contained in:
bumi 2020-04-16 17:17:40 +02:00
parent 7f653f23ce
commit 60ed697460

View File

@ -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}`);
}
};
}