Skip to content

Commit 62b8309

Browse files
authored
Update messageBox.py
kind of fixes a crash, when you try to read a chat from a deleted member.
1 parent c38814d commit 62b8309

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/messageBox.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ def get_messages_info(self, current_user):
8484
if dialog_type == 1 or dialog_type == 2:
8585
user_name = users[messages[i].sender.id].name
8686
user_name = user_name if prepare_forward_message is False else prepare_forward_message
87-
user_name = textwrap.wrap(user_name, self.width // 5)[0]
88-
87+
if(len(user_name)!=0):
88+
user_name = textwrap.wrap(user_name, self.width // 5)[0]
89+
else:
90+
user_name = "Deleted Account"
8991
offset = " " * (max_name_len - (len(user_name)))
9092
name = read + user_name + ":" + offset
9193
color = (len(read) + len(user_name)) * [users[messages[i].sender.id].color]

0 commit comments

Comments
 (0)