[geary] Geary.ImapDb.Database: Fix criticals when ::run_gc to_pause is null



commit f6af688623dfe532d402a1cb18f34de8f32c73e2
Author: Michael Gratton <mike vee net>
Date:   Wed Jul 1 11:50:55 2020 +1000

    Geary.ImapDb.Database: Fix criticals when ::run_gc to_pause is null

 src/engine/imap-db/imap-db-database.vala | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/engine/imap-db/imap-db-database.vala b/src/engine/imap-db/imap-db-database.vala
index e8228feb1..5ede9824c 100644
--- a/src/engine/imap-db/imap-db-database.vala
+++ b/src/engine/imap-db/imap-db-database.vala
@@ -130,8 +130,10 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
         if ((recommended & GC.RecommendedOperation.VACUUM) != 0) {
             if (GarbageCollectionOptions.ALLOW_VACUUM in options) {
                 this.want_background_vacuum = false;
-                foreach (ClientService service in to_pause) {
-                    yield service.stop(gc_cancellable);
+                if (to_pause != null) {
+                    foreach (ClientService service in to_pause) {
+                        yield service.stop(gc_cancellable);
+                    }
                 }
 
                 if (!vacuum_monitor.is_in_progress)
@@ -149,8 +151,10 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
                         vacuum_monitor.notify_finish();
                 }
 
-                foreach (ClientService service in to_pause) {
-                    yield service.start(gc_cancellable);
+                if (to_pause != null) {
+                    foreach (ClientService service in to_pause) {
+                        yield service.start(gc_cancellable);
+                    }
                 }
             } else {
                 // Flag a vacuum to run later when we've been idle in the background


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]