mirror of
https://github.com/mvt-project/mvt.git
synced 2026-02-13 00:52:44 +00:00
Handle better some empty database issues in iOS backups
This commit is contained in:
@@ -40,14 +40,18 @@ class Contacts(IOSExtraction):
|
||||
|
||||
conn = sqlite3.connect(self.file_path)
|
||||
cur = conn.cursor()
|
||||
cur.execute("""
|
||||
SELECT
|
||||
multi.value, person.first, person.middle, person.last,
|
||||
person.organization
|
||||
FROM ABPerson person, ABMultiValue multi
|
||||
WHERE person.rowid = multi.record_id and multi.value not null
|
||||
ORDER by person.rowid ASC;
|
||||
""")
|
||||
try:
|
||||
cur.execute("""
|
||||
SELECT
|
||||
multi.value, person.first, person.middle, person.last,
|
||||
person.organization
|
||||
FROM ABPerson person, ABMultiValue multi
|
||||
WHERE person.rowid = multi.record_id and multi.value not null
|
||||
ORDER by person.rowid ASC;
|
||||
""")
|
||||
except sqlite3.OperationalError as e:
|
||||
self.log.info("Error while reading the contact table: %s", e)
|
||||
return None
|
||||
names = [description[0] for description in cur.description]
|
||||
|
||||
for row in cur:
|
||||
|
||||
@@ -284,7 +284,11 @@ class InteractionC(IOSExtraction):
|
||||
try:
|
||||
cur.execute(QUERIES[2])
|
||||
except sqlite3.OperationalError:
|
||||
cur.execute(QUERIES[3])
|
||||
try:
|
||||
cur.execute(QUERIES[3])
|
||||
except sqlite3.OperationalError as e:
|
||||
self.log.info("Error while reading the InteractionC table: %s", e)
|
||||
return None
|
||||
|
||||
names = [description[0] for description in cur.description]
|
||||
for item in cur:
|
||||
|
||||
Reference in New Issue
Block a user