Skip to content

Commit 7cfdfcc

Browse files
committed
Fix crash on messages from unknown accounts.
1 parent 456c53d commit 7cfdfcc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wxbot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ def handle_msg(self, r):
410410
elif self.is_special(msg['FromUserName']): # Special
411411
msg_type_id = 6
412412
user['name'] = self.get_prefer_name(self.get_account_name(user['id']))
413+
else:
414+
msg_type_id = 99
415+
user['name'] = 'unknown'
413416

414417
if self.DEBUG and msg_type_id != 0:
415418
print '[MSG] %s:' % user['name']

0 commit comments

Comments
 (0)