Permalink
Browse files

Prevent nil comments from entering the comment list

  • Loading branch information...
1 parent 5db6af4 commit 34f3bfd6ed8bdb5ed1e3d3a78d143ec5a16a27c7 @jimweirich committed Oct 9, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/rake/task.rb
View
@@ -262,6 +262,7 @@ def comment=(comment)
end
def add_comment(comment)
+ return if comment.nil?
@comments << comment unless @comments.include?(comment)
end
private :add_comment
@@ -281,7 +282,7 @@ def comment
# Transform the list of comments as specified by the block and
# join with the separator.
def transform_comments(separator, &block)
- if @comments.compact.empty?
+ if @comments.empty?
nil
else
block ||= lambda { |c| c }

0 comments on commit 34f3bfd

Please sign in to comment.