summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/delegate.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 1559c80542..220933c464 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -139,7 +139,7 @@ class Delegator
begin
__getobj__.__send__(:#{method}, *args, &block)
ensure
- $@.delete_if{|s|IgnoreBacktracePat=~s}
+ $@.delete_if{|s|IgnoreBacktracePat=~s} if $@
end
end
EOS
@@ -295,7 +295,7 @@ def DelegateClass(superclass)
begin
@_dc_obj.__send__(:#{method}, *args, &block)
ensure
- $@.delete_if{|s| ::Delegator::IgnoreBacktracePat =~ s}
+ $@.delete_if{|s| ::Delegator::IgnoreBacktracePat =~ s} if $@
end
end
EOS