]> git.cworth.org Git - sup/commitdiff
fix exception when editting an empty MULTI_HEADER
authorBen Walton <bwalton@artsci.utoronto.ca>
Fri, 16 May 2008 16:52:11 +0000 (12:52 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 19 May 2008 15:10:08 +0000 (08:10 -0700)
In edit-message-mode, an exception is generated by pressing 'c' to edit the Cc
field when no value currently exists.  This is due to calling Array.join() on
nil.  This patch addresses the execption by forcing an empty array when the
current value is nil.

lib/sup/modes/edit-message-mode.rb

index 8bb7756bc39a366abc525a616d5f61250f295451..b2b60eb043290201b7aecbca6fa45cb4628a5012 100644 (file)
@@ -383,6 +383,7 @@ protected
       default =
         case field
         when *MULTI_HEADERS
+         @header[field] ||= []
           @header[field].join(", ")
         else
           @header[field]