Avoid calling line_number on String node when rescuing a render error.

This commit is contained in:
Dylan Thacker-Smith
2017-02-07 15:34:10 -05:00
parent 25c7b05916
commit 5dcefd7d77
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -93,10 +93,11 @@ module Liquid
rescue MemoryError => e
raise e
rescue UndefinedVariable, UndefinedDropMethod, UndefinedFilter => e
context.handle_error(e, token.line_number, token.raw)
context.handle_error(e, token.line_number)
output << nil
rescue ::StandardError => e
output << context.handle_error(e, token.line_number, token.raw)
line_number = token.is_a?(String) ? nil : token.line_number
output << context.handle_error(e, line_number)
end
end