Fix truncate_nick()’s types to include None.

It is relied on in quite a few places which don’t check for None before
calling it on messages which have no nick.
This commit is contained in:
Emmanuel Gil Peyrot 2018-10-18 22:00:32 +02:00
parent 08d31d4fc7
commit d626aa1533

View file

@ -22,7 +22,7 @@ def find_first_format_char(text: str,
return pos
def truncate_nick(nick: str, size=10) -> str:
def truncate_nick(nick: Optional[str], size=10) -> Optional[str]:
if size < 1:
size = 1
if nick and len(nick) > size: