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:
parent
08d31d4fc7
commit
d626aa1533
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue