mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Fix sqlite's conn may be None if never used
This happened when signing up with the library and getting migrate errors.
This commit is contained in:
@@ -231,7 +231,8 @@ class SQLiteSession(MemorySession):
|
||||
"""Saves the current session object as session_user_id.session"""
|
||||
# This is a no-op if there are no changes to commit, so there's
|
||||
# no need for us to keep track of an "unsaved changes" variable.
|
||||
self._conn.commit()
|
||||
if self._conn is not None:
|
||||
self._conn.commit()
|
||||
|
||||
def _cursor(self):
|
||||
"""Asserts that the connection is open and returns a cursor"""
|
||||
|
Reference in New Issue
Block a user