Detect values of None in utils.get_irc()

The intent for the get_irc() function is to return an empty string
when no nick is found, but the API tends to provide a null (None)
value explicitly. When this happens, convert it to the empty string
too.

Change-Id: I9b62b1d722136246d1987a1a45ca771bdc02579c
This commit is contained in:
Jeremy Stanley 2019-09-05 20:22:39 +00:00
parent ebcd45e865
commit c48852e3bb

View File

@ -178,6 +178,9 @@ def get_irc(member, filepath=None):
member_data = member.get('data', [])
if member_data:
irc = member_data[0].get('irc', '')
# The API can return None for nonexistent nicks
if irc is None:
irc = ''
return irc