No longer crashes when running for the first time: #3798

Problem was that the client fetches folder objects for the special folders (Inbox, Drafts, etc.) prior to fetching the full folder list and the Engine's fetch_folder_async() call wasn't prepared to handle fetches for folders not located in the local database.
This commit is contained in:
Jim Nelson 2011-07-04 13:54:00 -07:00
parent fff39e8a44
commit 7f293f9a6f
6 changed files with 92 additions and 9 deletions

View file

@ -85,6 +85,20 @@ public class Geary.Sqlite.Account : Geary.AbstractAccount, Geary.LocalAccount {
return folders;
}
public override async bool folder_exists_async(Geary.FolderPath path,
Cancellable? cancellable = null) throws Error {
try {
int64 id = yield fetch_id_async(path, cancellable);
return (id != Row.INVALID_ID);
} catch (EngineError err) {
if (err is EngineError.NOT_FOUND)
return false;
else
throw err;
}
}
public override async Geary.Folder fetch_folder_async(Geary.FolderPath path,
Cancellable? cancellable = null) throws Error {
FolderRow? row = yield folder_table.fetch_descend_async(path.as_list(), cancellable);