diff --git a/db.py b/db.py
index fe6ae4ab935f5958009426e0c4ef6fa8f3c8ff1a..6678966139ead62fc041bc5cfc53d7a8e48bad8b 100644
--- a/db.py
+++ b/db.py
@@ -61,7 +61,14 @@ def query(operation, *params, delim="sep"):
 	operation, params = fix_query(operation, params)
 	cur = get_dbcursor()
 	cur.execute(operation, params)
-	rows = cur.fetchall()
+	try
+		rows = cur.fetchall()
+	except mysql.connector.errors.InterfaceError as ie:
+		if ie.msg == 'No result set to fetch from.':
+			# no problem, we were just at the end of the result set
+			pass
+		else:
+			raise
 	res = []
 	for row in rows:
 		res.append({})