From 491f488f5ac4e50abfbd1a434971e41e48aa2f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 3 Nov 2015 22:46:27 -0200 Subject: Fix deprecation message when frame doesn't have absolute_path When a frame is an eval block without filename argument there is no absolute_path so the previous implementation would fail because `nil` doesn't responds to `start_with?`. --- activesupport/lib/active_support/deprecation/reporting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/deprecation/reporting.rb b/activesupport/lib/active_support/deprecation/reporting.rb index bbe25c9260..f89fc0fe14 100644 --- a/activesupport/lib/active_support/deprecation/reporting.rb +++ b/activesupport/lib/active_support/deprecation/reporting.rb @@ -83,7 +83,7 @@ module ActiveSupport rails_gem_root = File.expand_path("../../../../..", __FILE__) + "/" offending_line = callstack.find { |frame| - !frame.absolute_path.start_with?(rails_gem_root) + frame.absolute_path && !frame.absolute_path.start_with?(rails_gem_root) } || callstack.first [offending_line.path, offending_line.lineno, offending_line.label] end -- cgit v1.2.3