misc
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user