Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 620c1e59 authored by Matt Mower's avatar Matt Mower Committed by Gerrit Code Review
Browse files

repopick: Don't crash if change not found

If change is not located, skip it. Resolves the following:

Traceback (most recent call last):
  File "(omitted)/build/tools/repopick.py", line 258,
in <module>
    review = [x for x in reviews if x['number'] == change][0]
IndexError: list index out of range

Change-Id: I96423ddc809ac1c7994998db4e1929ca813f20ca
parent 521a73ba
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -255,7 +255,11 @@ if __name__ == '__main__':
            continue

        change = int(change)
        review = [x for x in reviews if x['number'] == change][0]
        review = next((x for x in reviews if x['number'] == change), None)
        if review is None:
            print('Change %d not found, skipping' % change)
            continue

        mergables.append({
            'subject': review['subject'],
            'project': review['project'],