summaryrefslogtreecommitdiff
path: root/alot/commands/envelope.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-07-18 08:55:46 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-07-26 10:32:39 -0700
commitb19d58f556932eec92e3cf27f6c018791415367d (patch)
tree26afda5b6eef6eb7d42450fa77b57848a19a32ea /alot/commands/envelope.py
parent6ad6cbf33fe203e504c8623631746068850ee16f (diff)
commands/envelope: check that self.envelope is not None
If the mail is passed a string then envelope will always be None. There is one case in the final callback where self.envelope is assumed set, but it isn't guaranteed to be, so guard that properly.
Diffstat (limited to 'alot/commands/envelope.py')
-rw-r--r--alot/commands/envelope.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 000e14db..80e13fba 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -246,10 +246,11 @@ class SendCommand(Command):
cmd = commands.globals.BufferCloseCommand(self.envelope_buffer)
ui.apply_command(cmd)
ui.notify('mail sent successfully')
- if self.envelope.replied:
- self.envelope.replied.add_tags(account.replied_tags)
- if self.envelope.passed:
- self.envelope.passed.add_tags(account.passed_tags)
+ if self.envelope is not None:
+ if self.envelope.replied:
+ self.envelope.replied.add_tags(account.replied_tags)
+ if self.envelope.passed:
+ self.envelope.passed.add_tags(account.passed_tags)
# store mail locally
# This can raise StoreMailError