mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -05:00
Handle template error gracefully when line number cannot be derived. Closes #11327 [Nex3]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9027 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -41,8 +41,9 @@ module ActionView
|
||||
|
||||
indent = ' ' * indentation
|
||||
line_counter = start_on_line
|
||||
|
||||
source_code[start_on_line..end_on_line].sum do |line|
|
||||
return unless source_code = source_code[start_on_line..end_on_line]
|
||||
|
||||
source_code.sum do |line|
|
||||
line_counter += 1
|
||||
"#{indent}#{line_counter}: #{line}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user