From cf36e062ecaaf416904dc948110fbb796b76bb0d Mon Sep 17 00:00:00 2001 From: Eric Gregory Date: Mon, 14 Nov 2011 15:57:18 -0800 Subject: [PATCH] Fixed critical warning when loading new messages --- src/engine/impl/geary-generic-imap-folder.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/impl/geary-generic-imap-folder.vala b/src/engine/impl/geary-generic-imap-folder.vala index f7bd7a81..0a18e236 100644 --- a/src/engine/impl/geary-generic-imap-folder.vala +++ b/src/engine/impl/geary-generic-imap-folder.vala @@ -107,7 +107,6 @@ private class Geary.GenericImapFolder : Geary.EngineFolder { // fetch email from earliest email to last to (a) remove any deletions and (b) update // any flags that may have changed Geary.Imap.UID? earliest_uid = yield imap_local_folder.get_earliest_uid_async(cancellable); - int64 full_uid_count = local_properties.uid_next.value - 1 - earliest_uid.value; // if no earliest UID, that means no messages in local store, so nothing to update if (earliest_uid == null || !earliest_uid.is_valid()) { @@ -116,6 +115,8 @@ private class Geary.GenericImapFolder : Geary.EngineFolder { return true; } + int64 full_uid_count = local_properties.uid_next.value - 1 - earliest_uid.value; + // If no UID's, nothing to update if (full_uid_count <= 0 || (full_uid_count > int.MAX)) { debug("No valid UID range in local folder %s (count=%lld), nothing to update", to_string(),