This commit is contained in:
2025-09-09 15:50:13 -04:00
parent a57173b90a
commit f6d4ed57f3
5 changed files with 225 additions and 89 deletions

View File

@@ -26,6 +26,7 @@ class MemeUtil:
bool
"""
# Accepts either bytes or a BytesIO-like object
signature = None
if isinstance(buffer, io.BytesIO):
if hasattr(buffer, "read") and hasattr(buffer, "seek"):
pos = buffer.tell()
@@ -153,6 +154,8 @@ class MemeUtil:
query: str = "SELECT count(id) AS count FROM memes"
async with await db_conn.execute(query) as db_cursor:
result = await db_cursor.fetchone()
if not result:
return None
count = result["count"]
if not isinstance(count, int):
return None