From d626aa15339de2e573dd0ac7b20f54406210f76f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 18 Oct 2018 22:00:32 +0200 Subject: =?UTF-8?q?Fix=20truncate=5Fnick()=E2=80=99s=20types=20to=20includ?= =?UTF-8?q?e=20None.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is relied on in quite a few places which don’t check for None before calling it on messages which have no nick. --- poezio/windows/funcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poezio/windows/funcs.py b/poezio/windows/funcs.py index 69edace2..22977374 100644 --- a/poezio/windows/funcs.py +++ b/poezio/windows/funcs.py @@ -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: -- cgit v1.2.3