From: Jean-Philippe Lang Date: Sun, 18 Jan 2015 11:45:08 +0000 (+0000) Subject: Prevents calling #truncate on nil. X-Git-Tag: 3.0.0~125 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=93d270388ba94556d84f789124a48f5eec6ae76c;p=redmine.git Prevents calling #truncate on nil. git-svn-id: http://svn.redmine.org/redmine/trunk@13897 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0a6af7da6..783cd7758 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -397,7 +397,7 @@ module ApplicationHelper end def truncate_single_line_raw(string, length) - string.truncate(length).gsub(%r{[\r\n]+}m, ' ') + string.to_s.truncate(length).gsub(%r{[\r\n]+}m, ' ') end # Truncates at line break after 250 characters or options[:length]