From 93d270388ba94556d84f789124a48f5eec6ae76c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 18 Jan 2015 11:45:08 +0000 Subject: [PATCH] Prevents calling #truncate on nil. git-svn-id: http://svn.redmine.org/redmine/trunk@13897 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] -- 2.39.5