#2307 get_notification_recipients() can return None, leading to build_notification() crash
Closed: Fixed by tkopecek. Opened by ktdreyer.

As reported on koji-devel (Subject "Error: ": object of type 'NoneType' has no len()"> in koji"), the hub's host.completeBuild RPC can crash in some cases.

The problem is that 6ae165f77bdc15b85670161c986224f275731ff3 changed get_notification_recipients() to return None in specific circumstances. When we call len() on None in build_notification(), we get a TypeError.

To fix this, we should make get_notification_recipients() return an empty list instead of None.

(Additionally, we should simplify that if len(recipients) > 0: conditional in build_notification() to just simply if recipients: so that is easier to read.)


PR #2308 fixes this bug.

PR #2309 cleans up the conditional in build_notification() to make the code easier to read.

Metadata Update from @mikem:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.22

Metadata Update from @mikem:
- Custom field Size adjusted to small (was: None)

Commit eb8d7f92 fixes this issue

Commit 4fb79b9e fixes this issue

Metadata Update from @jcupova:
- Issue tagged with: testing-ready

Metadata Update from @mfilip:
- Issue tagged with: testing-done

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/2307

Please continue any further discussion there.

Metadata
Related Pull Requests