Skip to content

Commit

Permalink
fix: deal with text is None
Browse files Browse the repository at this point in the history
Signed-off-by: jingfelix <jingfelix@outlook.com>
  • Loading branch information
jingfelix committed Mar 1, 2024
1 parent ad3a067 commit 921a8dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/repo2lark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def truncate(text: str, length: int = 80) -> str:
Returns:
Truncated text.
"""
if text is None:
return ""
if len(text) > length:
return text[: length - 3] + "..."
return text
Expand Down

0 comments on commit 921a8dd

Please sign in to comment.