summaryrefslogtreecommitdiff
path: root/lib/json/common.rb
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-11-03 13:19:21 +0100
committerFlorian Frank <flori@ping.de>2011-11-03 13:19:21 +0100
commitb50b1bdeaec8759bdf0d11e1c1f942e0ed6542f5 (patch)
tree8521bcb763a379592cfdd6ea6fab6f8d839fd1c4 /lib/json/common.rb
parent6bd324502763b85914e98bcd9eb97615306146a4 (diff)
downloadjson-b50b1bdeaec8759bdf0d11e1c1f942e0ed6542f5.tar.gz
probe for read before calling it
Diffstat (limited to 'lib/json/common.rb')
-rw-r--r--lib/json/common.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/json/common.rb b/lib/json/common.rb
index 43e249c..e0d55a0 100644
--- a/lib/json/common.rb
+++ b/lib/json/common.rb
@@ -296,7 +296,7 @@ module JSON
source = source.to_str
elsif source.respond_to? :to_io
source = source.to_io.read
- else
+ elsif source.respond_to?(:read)
source = source.read
end
result = parse(source, :max_nesting => false, :allow_nan => true)