Avoid database error when adding attachments
do_save_attachments() is called by schema update 22, which is prior to when DeleteAttachmentFileTable was introduced (in update 24). Ignore error if cannot remove from that table, i.e. it doesn't exist yet.
This commit is contained in:
parent
260436e92c
commit
ee7efd3a93
1 changed files with 13 additions and 7 deletions
|
|
@ -1990,13 +1990,19 @@ private class Geary.ImapDB.Folder : BaseObject, Geary.ReferenceSemantics {
|
|||
attachment_id, filename);
|
||||
|
||||
// On the off-chance this is marked for deletion, unmark it
|
||||
stmt = cx.prepare("""
|
||||
DELETE FROM DeleteAttachmentFileTable
|
||||
WHERE filename = ?
|
||||
""");
|
||||
stmt.bind_string(0, saved_file.get_path());
|
||||
|
||||
stmt.exec(cancellable);
|
||||
try {
|
||||
stmt = cx.prepare("""
|
||||
DELETE FROM DeleteAttachmentFileTable
|
||||
WHERE filename = ?
|
||||
""");
|
||||
stmt.bind_string(0, saved_file.get_path());
|
||||
|
||||
stmt.exec(cancellable);
|
||||
} catch (Error err) {
|
||||
debug("Unable to delete from DeleteAttachmentFileTable: %s", err.message);
|
||||
|
||||
// not a deal-breaker, fall through
|
||||
}
|
||||
|
||||
debug("Saving attachment to %s", saved_file.get_path());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue