From 9eea97f1e1d3375f38ded58f3dee5e9648e45a37 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 18 Sep 2023 13:39:13 +0200 Subject: [PATCH] CI: Make mypy happy cleanmedia:133: error: Value of type "tuple[Any, ...] | None" is not indexable [index] So we do sanity check that row is not None now before doing something with row[0]. --- cleanmedia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanmedia b/cleanmedia index 18486d2..59759dc 100755 --- a/cleanmedia +++ b/cleanmedia @@ -130,7 +130,7 @@ class MediaRepository: with self.conn.cursor() as cur: cur.execute("SELECT COUNT(media_id) from mediaapi_thumbnail WHERE media_id NOT IN (SELECT media_id FROM mediaapi_media_repository);") row = cur.fetchone() - if row[0]: + if row is not None and row[0]: logging.error("You have {} thumbnails in your db that do not refer to media. This needs fixing (we don't do that)!".format(row[0]))