From 69be9c7c073c1799426c8b735b3e2d12cd2ab2e1 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 8 Jan 2022 22:33:55 +0100 Subject: [PATCH] Allow empty subscription table --- src/Utils/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Utils/__init__.py b/src/Utils/__init__.py index 6747e4c..8bf51b7 100644 --- a/src/Utils/__init__.py +++ b/src/Utils/__init__.py @@ -137,9 +137,12 @@ def get_subscriptions(basepath: str = BASEPATH, con = sqlite3.connect(fullpath) cur = con.cursor() select_query = '''SELECT * FROM {}'''.format(SUB_TABLE) - cur.execute(select_query) - for result in cur.fetchall(): - subscriptions.append(result) + try: + cur.execute(select_query) + for result in cur.fetchall(): + subscriptions.append(result) + except sqlite3.OperationalError: + pass return subscriptions