From 2093aa32292e11455648d62d8b7a992532aac04e Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Wed, 23 Sep 2020 08:44:04 +1000 Subject: [PATCH 022/124] Geary.Imap.Session: Avoid critical when client session logged out If the client session is being logging out but some other tasks is still attempting to use it, getting a mailbox will assume at least one personal namespace exists, but it will have been cleared. Add a check and throw an exception if none are present, so at least it is handled in a well defined way. Fixes #986 --- src/engine/imap/transport/imap-client-session.vala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/imap/transport/imap-client-session.vala b/src/engine/imap/transport/imap-client-session.vala index f42112f2..81d892ef 100644 --- a/src/engine/imap/transport/imap-client-session.vala +++ b/src/engine/imap/transport/imap-client-session.vala @@ -599,6 +599,9 @@ public class Geary.Imap.ClientSession : BaseObject, Logging.Source { } if (ns == null) { // fall back to the default personal namespace + if (this.personal_namespaces.is_empty) { + throw new ImapError.UNAVAILABLE("No personal namespace"); + } ns = this.personal_namespaces[0]; } -- 2.29.2