mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-23 01:46:35 +03:00
Fix session table may be empty if no DC switch
This commit is contained in:
parent
50d413b1c9
commit
4a139b0ae4
|
@ -97,10 +97,12 @@ class Session:
|
||||||
|
|
||||||
# These values will be saved
|
# These values will be saved
|
||||||
c.execute('select * from sessions')
|
c.execute('select * from sessions')
|
||||||
self._dc_id, self._server_address, self._port, key, = c.fetchone()
|
tuple_ = c.fetchone()
|
||||||
|
if tuple_:
|
||||||
|
self._dc_id, self._server_address, self._port, key, = tuple_
|
||||||
|
from ..crypto import AuthKey
|
||||||
|
self._auth_key = AuthKey(data=key)
|
||||||
|
|
||||||
from ..crypto import AuthKey
|
|
||||||
self._auth_key = AuthKey(data=key)
|
|
||||||
c.close()
|
c.close()
|
||||||
else:
|
else:
|
||||||
# Tables don't exist, create new ones
|
# Tables don't exist, create new ones
|
||||||
|
|
Loading…
Reference in New Issue
Block a user