hub: return empty list in get_notification_recipients()

If we find no recipients, return an empty list, rather than None.

This fixes a crash in build_notifications() where we expect to call
len() on the return value from get_notification_recipients().

Fixes: https://pagure.io/koji/issue/2307
This commit is contained in:
Ken Dreyer 2020-06-11 15:13:42 -06:00 committed by Tomas Kopecek
parent 2ed90d0600
commit 4fb79b9e9f

View file

@ -8383,7 +8383,7 @@ def get_notification_recipients(build, tag_id, state):
# using all package owners from all tags would be way overkill.
if not recipients:
return None
return []
# apply the out outs
user_ids = list(set([r['user_id'] for r in recipients]))