From a8f2d1c1ab8121ff16b2eb05421891c9e4d2d74e Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Mon, 6 Mar 2017 20:47:17 +0200 Subject: [PATCH] Handle empty payout address case gracefully * log error instead of crashing if a bounty issue gets merged and bounty winner has no address --- src/clj/commiteth/scheduler.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/clj/commiteth/scheduler.clj b/src/clj/commiteth/scheduler.clj index 1e39b91..0d9aeb5 100644 --- a/src/clj/commiteth/scheduler.clj +++ b/src/clj/commiteth/scheduler.clj @@ -50,9 +50,11 @@ issue-id :issue_id payout-address :payout_address} (db-bounties/pending-bounties-list) :let [value (eth/get-balance-hex contract-address)]] - (->> - (wallet/execute contract-address payout-address value) - (db-bounties/update-execute-hash issue-id)))) + (if (empty? payout-address) + (log/error "Cannot sign pending bounty - winner has no payout address") + (->> + (wallet/execute contract-address payout-address value) + (db-bounties/update-execute-hash issue-id))))) (defn update-confirm-hash "Gets transaction receipt for each pending payout and updates confirm_hash"