#300: better guard around nil properties
This commit is contained in:
parent
ef4e1f411e
commit
f654e0452f
|
@ -107,12 +107,14 @@
|
|||
(issues/update-issue-title (:id gh-issue) (:title gh-issue)))))))
|
||||
|
||||
(defn bounty-state [bounty]
|
||||
(cond
|
||||
(:payout_hash bounty) :paid
|
||||
(nil? (:confirm_hash bounty)) :pending-maintainer-confirmation
|
||||
(nil? (:payout_address bounty)) :pending-contributor-address
|
||||
(:winner_login bounty) :merged
|
||||
(some-> (:claim_count bounty) (< 1)) :multiple_claims
|
||||
(= 1 (:claim_count bounty)) :claimed
|
||||
(seq (:tokens bounty)) :funded
|
||||
(:contract_address bounty) :opened))
|
||||
(if-let [merged? (:winner_login bounty)]
|
||||
(cond
|
||||
(nil? (:payout_address bounty)) :pending-contributor-address
|
||||
(nil? (:confirm_hash bounty)) :pending-maintainer-confirmation
|
||||
(:payout_hash bounty) :paid
|
||||
:else :merged)
|
||||
(cond ; not yet merged
|
||||
(some-> (:claim_count bounty) (< 1)) :multiple_claims
|
||||
(= 1 (:claim_count bounty)) :claimed
|
||||
(seq (:tokens bounty)) :funded
|
||||
(:contract_address bounty) :opened)))
|
||||
|
|
Loading…
Reference in New Issue