sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 861becad89df65d55ed3cbd001ab36b909154ca0
parent 0e1d70ece10efc171e5b91d101d253b1cc4db2a6
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun, 18 May 2025 16:59:35 +1000

rescue TypeError when sending mails

If the user has not set the "sendmail" key in their account config, we
will try to invoke Popen on nil, which is a TypeError.

Showing this TypeError to the user in a flash message is not very nice,
but it's still better than crashing and losing their draft.

Relates to #524.

Diffstat:
M lib/sup/modes/edit_message_mode.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
@@ -538,7 +538,7 @@ protected
       BufferManager.kill_buffer buffer
       BufferManager.flash "Message sent!"
       true
-    rescue SystemCallError, SendmailCommandFailed, CryptoManager::Error => e
+    rescue SystemCallError, SendmailCommandFailed, CryptoManager::Error, TypeError => e
       warn "Problem sending mail: #{e.message}"
       BufferManager.flash "Problem sending mail: #{e.message}"
       false