Commit d626aa15 authored by Link Mauve's avatar Link Mauve

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.
parent 08d31d4f
...@@ -22,7 +22,7 @@ def find_first_format_char(text: str, ...@@ -22,7 +22,7 @@ def find_first_format_char(text: str,
return pos return pos
def truncate_nick(nick: str, size=10) -> str: def truncate_nick(nick: Optional[str], size=10) -> Optional[str]:
if size < 1: if size < 1:
size = 1 size = 1
if nick and len(nick) > size: if nick and len(nick) > size:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment