Don't use row.get to be compatible with sqlite3.Row
This commit is contained in:
@@ -77,7 +77,10 @@ class TelegramFile:
|
|||||||
file = cls._from_row(row)
|
file = cls._from_row(row)
|
||||||
if file is None:
|
if file is None:
|
||||||
return None
|
return None
|
||||||
thumbnail_id = row.get("thumbnail", None)
|
try:
|
||||||
|
thumbnail_id = row["thumbnail"]
|
||||||
|
except KeyError:
|
||||||
|
thumbnail_id = None
|
||||||
if thumbnail_id and not _thumbnail:
|
if thumbnail_id and not _thumbnail:
|
||||||
file.thumbnail = await cls.get(thumbnail_id, _thumbnail=True)
|
file.thumbnail = await cls.get(thumbnail_id, _thumbnail=True)
|
||||||
return file
|
return file
|
||||||
|
|||||||
Reference in New Issue
Block a user