mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Fixed an error when trying to retrieve a deleted user while rendering a direct message
This commit is contained in:
parent
f512267b6d
commit
9763d8b26c
@ -411,7 +411,11 @@ class Session(base.baseSession):
|
|||||||
id str: User identifier, provided by Twitter.
|
id str: User identifier, provided by Twitter.
|
||||||
returns an user dict."""
|
returns an user dict."""
|
||||||
if ("users" in self.db) == False or (id in self.db["users"]) == False:
|
if ("users" in self.db) == False or (id in self.db["users"]) == False:
|
||||||
user = self.twitter.show_user(id=id)
|
try:
|
||||||
|
user = self.twitter.show_user(id=id)
|
||||||
|
except TwythonError:
|
||||||
|
user = dict(screen_name="deleted_account", name="Deleted account")
|
||||||
|
return user
|
||||||
self.db["users"][user["id_str"]] = user
|
self.db["users"][user["id_str"]] = user
|
||||||
return user
|
return user
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user