Merge branch 'master' into 4036-combine-collections-in-project-issue
[arvados.git] / apps / workbench / app / controllers / collections_controller.rb
index 3606ef0c8a8898fa798f8e09d2dd57cb21273dc6..3c248757ece6813e91bc74e6772b51922af758d9 100644 (file)
@@ -326,8 +326,7 @@ class CollectionsController < ApplicationController
       bytesleft = @opts[:maxbytes].andand.to_i || 2**16
       IO.popen([env, 'arv-get', "#{@opts[:uuid]}/#{@opts[:file]}"],
                'rb') do |io|
-        bytecount = 0
-        while bytesleft > 0 && buf = io.read(bytesleft)
+        while bytesleft > 0 && (buf = io.read(bytesleft)) != nil
           # shrink the bytesleft count, if we were given a
           # maximum byte count to read
           if @opts.include? :maxbytes