diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-11-03 22:46:27 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-11-03 22:46:27 -0200 |
commit | 491f488f5ac4e50abfbd1a434971e41e48aa2f15 (patch) | |
tree | df96cc8d690853411990aaaebae0ffb714e3f328 /activesupport/lib | |
parent | e37b470a6675a05df5a57455a3ac8c1c88ef04d6 (diff) | |
download | rails-491f488f5ac4e50abfbd1a434971e41e48aa2f15.tar.gz rails-491f488f5ac4e50abfbd1a434971e41e48aa2f15.tar.bz2 rails-491f488f5ac4e50abfbd1a434971e41e48aa2f15.zip |
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?`.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/deprecation/reporting.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |