aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-11-05 10:03:37 -0500
committerDrew DeVault <sir@cmpwn.com>2020-11-05 10:03:45 -0500
commit643047402d0f19965b768b44dbb070148fa2977f (patch)
treede2e8d514fe904f71baed1a070a023455ff96713
parente4daf0778dc4682405017a7cbdc593808257408f (diff)
downloadalps-643047402d0f19965b768b44dbb070148fa2977f.tar.gz
alps-643047402d0f19965b768b44dbb070148fa2977f.zip
Don't crash if Outbox is not present
Fixes #133
-rw-r--r--plugins/base/routes.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index ecdfc1a..2ef10ff 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -133,9 +133,7 @@ func newIMAPBaseRenderData(ctx *alps.Context,
if mboxName == "Outbox" {
outbox = active
} else {
- if outbox, err = getMailboxStatus(c, "Outbox"); err != nil {
- return err
- }
+ outbox, _ = getMailboxStatus(c, "Outbox")
}
return nil
})
@@ -165,7 +163,7 @@ func newIMAPBaseRenderData(ctx *alps.Context,
mailboxes[i].Unseen = int(inbox.Unseen)
mailboxes[i].Total = int(inbox.Messages)
}
- if mailboxes[i].Name == outbox.Name {
+ if outbox != nil && mailboxes[i].Name == outbox.Name {
mailboxes[i].Unseen = int(outbox.Unseen)
mailboxes[i].Total = int(outbox.Messages)
}