Don't use row.get to be compatible with sqlite3.Row

This commit is contained in:
Tulir Asokan
2022-09-20 18:43:41 +03:00
parent b2daebead6
commit 2d865f006e
+4 -1
View File
@@ -77,7 +77,10 @@ class TelegramFile:
file = cls._from_row(row)
if file is 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:
file.thumbnail = await cls.get(thumbnail_id, _thumbnail=True)
return file