From ebb642fa3a2b1a4e31abf9610ca634e6bb5d57d3 Mon Sep 17 00:00:00 2001 From: Tom Ward Date: Tue, 29 Apr 2008 13:21:51 +0100 Subject: Fix Dependencies watch_frames collection. [#24 state:resolved] Previously, the code collecting watch_frames could fail leaving watch_frames defined but nil. The cleanup code checks watch_frames is defined, but not that it holds a value, raising an undefined method on NilClass error rather than the original cause. This can make debugging the underlying cause a total pain. Signed-off-by: Pratik Naik --- activesupport/lib/active_support/dependencies.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index eaba46dd9c..25225d5615 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -384,7 +384,7 @@ module Dependencies #:nodoc: return new_constants ensure # Remove the stack frames that we added. - if defined?(watch_frames) && ! watch_frames.empty? + if defined?(watch_frames) && ! watch_frames.blank? frame_ids = watch_frames.collect(&:object_id) constant_watch_stack.delete_if do |watch_frame| frame_ids.include? watch_frame.object_id -- cgit v1.2.3