If we find no recipients, return an empty list, rather than None.
None
This fixes a crash in build_notifications() where we expect to call len() on the return value from get_notification_recipients().
build_notifications()
len()
get_notification_recipients()
Fixes: https://pagure.io/koji/issue/2307
I think PR #2309 is sufficient
:thumbsup:
It might resolve the issue at hand, but it seems more correct to return an empty list here. The def get_notification_recipients normally returns a list, and there is no clear meaning to returning None here.
def get_notification_recipients
The stanza where we were returning None is simple a slight optimization that skips the rest of the logic when the query is empty. If the function were to instead continue here, it would filter that empty list to another empty list and return it.
that makes sense
Commit eb8d7f92 fixes this pull-request
Pull-Request has been merged by tkopecek
Metadata Update from @mfilip: - Pull-request tagged with: testing-done
If we find no recipients, return an empty list, rather than
None.This fixes a crash in
build_notifications()where we expect to calllen()on the return value fromget_notification_recipients().Fixes: https://pagure.io/koji/issue/2307