Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 4036fcc5c4dedb44a57fc7787fcefb3b89096504 1 parent d7f84f6
@lifo lifo authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_view/template_error.rb
View
5 actionpack/lib/action_view/template_error.rb
@@ -41,8 +41,9 @@ def source_extract(indentation = 0)
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
Please sign in to comment.
Something went wrong with that request. Please try again.