Allow empty subscription table

This commit is contained in:
Micke Nordin 2022-01-08 22:33:55 +01:00
parent ea9379be7f
commit 69be9c7c07
Signed by: micke
GPG key ID: 014B273D614BE877

View file

@ -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