fix: reading chunks from an empty (zero-length) grid-stored file

reading chunks from an empty file caused an endless loop
This commit is contained in:
Daniël van de Burgt 2011-05-10 22:58:50 -05:00
parent 3cb1e4644b
commit 6e66b11f6e
1 changed files with 2 additions and 1 deletions

View File

@ -253,6 +253,7 @@ module Mongo
return read_all unless block_given? return read_all unless block_given?
while chunk = read(chunk_size) while chunk = read(chunk_size)
yield chunk yield chunk
break if chunk.empty?
end end
self self
end end