mirror of
https://github.com/mvt-project/mvt.git
synced 2024-06-02 03:05:30 +00:00
Catches exception in Shortcuts module if the table does not exist
This commit is contained in:
parent
28d57e7178
commit
e0514b20dd
|
@ -57,17 +57,25 @@ class Shortcuts(IOSExtraction):
|
||||||
conn = sqlite3.connect(self.file_path)
|
conn = sqlite3.connect(self.file_path)
|
||||||
conn.text_factory = bytes
|
conn.text_factory = bytes
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
cur.execute("""
|
try:
|
||||||
SELECT
|
cur.execute("""
|
||||||
ZSHORTCUT.Z_PK as "shortcut_id",
|
SELECT
|
||||||
ZSHORTCUT.ZNAME as "shortcut_name",
|
ZSHORTCUT.Z_PK as "shortcut_id",
|
||||||
ZSHORTCUT.ZCREATIONDATE as "created_date",
|
ZSHORTCUT.ZNAME as "shortcut_name",
|
||||||
ZSHORTCUT.ZMODIFICATIONDATE as "modified_date",
|
ZSHORTCUT.ZCREATIONDATE as "created_date",
|
||||||
ZSHORTCUT.ZACTIONSDESCRIPTION as "description",
|
ZSHORTCUT.ZMODIFICATIONDATE as "modified_date",
|
||||||
ZSHORTCUTACTIONS.ZDATA as "action_data"
|
ZSHORTCUT.ZACTIONSDESCRIPTION as "description",
|
||||||
FROM ZSHORTCUT
|
ZSHORTCUTACTIONS.ZDATA as "action_data"
|
||||||
LEFT JOIN ZSHORTCUTACTIONS ON ZSHORTCUTACTIONS.ZSHORTCUT == ZSHORTCUT.Z_PK;
|
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]
|
names = [description[0] for description in cur.description]
|
||||||
|
|
||||||
for item in cur:
|
for item in cur:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user