From: Carl Worth Date: Fri, 25 Sep 2009 20:41:06 +0000 (-0700) Subject: Fix uninitialized @name member in person.rb. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=3f69617ea17bf316cef829496834c56193dce2fb;p=sup Fix uninitialized @name member in person.rb. Apparently a Person can be initialized with a nil name, (presumably from a message where there's no name given), which before this commit resulted in the following warning: ./lib/sup/person.rb:46: warning: instance variable @name not initialized This warning was especially unpleasant since it appeared in the current window, causing the terminal contents to incorrectly scroll up, (as opposed to just appearing in the log or so). --- diff --git a/lib/sup/person.rb b/lib/sup/person.rb index c4f40a5..cd5b1ea 100644 --- a/lib/sup/person.rb +++ b/lib/sup/person.rb @@ -11,6 +11,8 @@ class Person if @name =~ /^(['"]\s*)(.*?)(\s*["'])$/ @name = $2 end + else + @name = nil end @email = email.gsub(/^\s+|\s+$/, "").gsub(/\s+/, " ").downcase