about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-09 10:02:49 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-09 10:09:57 -0700
commit7eb0c4e29e567f02affc202b51eb277cbae43688 (patch)
tree59b2aa2efe2cc427cddc5638d1ccc152454419e8 /lib
parent72dfd64ed0ab31ced0f27e8a8a941c555221bb96 (diff)
downloadclogger-7eb0c4e29e567f02affc202b51eb277cbae43688.tar.gz
Since the wrapped Clogger object always responds to
close, we cannot blindly delegate the close method to
the body without ensuring it can be closed.  So ensure
that it can be closed before attempting to close it,
all return values and errors are trapped and returned.

Reported-by: IƱaki Baz Castillo
Diffstat (limited to 'lib')
-rw-r--r--lib/clogger/pure.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/clogger/pure.rb b/lib/clogger/pure.rb
index 2800802..da2c1de 100644
--- a/lib/clogger/pure.rb
+++ b/lib/clogger/pure.rb
@@ -47,7 +47,7 @@ class Clogger
   end
 
   def close
-    @body.close
+    @body.close if @body.respond_to?(:close)
   end
 
   def reentrant?