]> git.notmuchmail.org Git - sup/commitdiff
handle nil header values in crypto recipient key selection
authorNicolas Pouillard <nicolas.pouillard@gmail.com>
Fri, 4 Apr 2008 16:01:45 +0000 (18:01 +0200)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Fri, 25 Apr 2008 16:39:37 +0000 (09:39 -0700)
lib/sup/modes/edit-message-mode.rb

index f4d933387c84be3758fd64575f911a39fc7a1c7d..8bb7756bc39a366abc525a616d5f61250f295451 100644 (file)
@@ -321,7 +321,7 @@ protected
     ## do whatever crypto transformation is necessary
     if @crypto_selector && @crypto_selector.val != :none
       from_email = PersonManager.person_for(@header["From"]).email
-      to_email = (@header["To"] + @header["Cc"] + @header["Bcc"]).map { |p| PersonManager.person_for(p).email }
+      to_email = [@header["To"], @header["Cc"], @header["Bcc"]].flatten.compact.map { |p| PersonManager.person_for(p).email }
 
       m = CryptoManager.send @crypto_selector.val, from_email, to_email, m
     end