diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-30 13:31:52 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-30 13:31:52 +0100 |
commit | 60525148e7532934913b56586ccdd4c37b74a637 (patch) | |
tree | 38b6387a303cf4c4bf0316feeb1c773e45b69774 /danger/roulette | |
parent | 0ed961a81a526e105ac3a6fe74b797183674d591 (diff) | |
download | gitlab-ce-60525148e7532934913b56586ccdd4c37b74a637.tar.gz |
Fix reviewer roulette when no-one is in a category
This would return `people.size` before, when it should return `nil`.
Diffstat (limited to 'danger/roulette')
-rw-r--r-- | danger/roulette/Dangerfile | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile index 27763052192..62e5526c02b 100644 --- a/danger/roulette/Dangerfile +++ b/danger/roulette/Dangerfile @@ -57,10 +57,12 @@ def spin_for_person(people, random:) people.size.times do person = people.sample(random: random) - return person unless out_of_office?(person) + break person unless out_of_office?(person) people -= [person] end + + person end def out_of_office?(person) |