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

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

The problem is that 6ae165f 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

3 years ago

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

3 years ago

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

3 years ago

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

3 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2308 Merged 3 years ago