From 4fb79b9e9fef7de4c352a6622fb858c76756e5d9 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Thu, 11 Jun 2020 15:13:42 -0600 Subject: [PATCH] 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 --- hub/kojihub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hub/kojihub.py b/hub/kojihub.py index 31eebce0..52a0b06a 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -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]))