Catches exception in Shortcuts module if the table does not exist

This commit is contained in:
tek 2022-01-10 16:58:12 +01:00
parent 28d57e7178
commit e0514b20dd

View File

@ -57,6 +57,7 @@ class Shortcuts(IOSExtraction):
conn = sqlite3.connect(self.file_path)
conn.text_factory = bytes
cur = conn.cursor()
try:
cur.execute("""
SELECT
ZSHORTCUT.Z_PK as "shortcut_id",
@ -68,6 +69,13 @@ class Shortcuts(IOSExtraction):
FROM ZSHORTCUT
LEFT JOIN ZSHORTCUTACTIONS ON ZSHORTCUTACTIONS.ZSHORTCUT == ZSHORTCUT.Z_PK;
""")
except sqlite3.OperationalError:
# Table ZSHORTCUT does not exist
self.log.info("Invalid shortcut database format, skipping...")
cur.close()
conn.close()
return
names = [description[0] for description in cur.description]
for item in cur: