diff --git a/app/controllers/stash_api/datasets_controller.rb b/app/controllers/stash_api/datasets_controller.rb index 3230debdd4..151a2023bb 100644 --- a/app/controllers/stash_api/datasets_controller.rb +++ b/app/controllers/stash_api/datasets_controller.rb @@ -390,7 +390,7 @@ def update def download res = @stash_identifier.latest_downloadable_resource(user: @user) @version_presigned = Stash::Download::VersionPresigned.new(controller_context: self, resource: res) - if res&.may_download?(ui_user: @user) && @zip_version_presigned.valid_resource? + if res&.may_download?(ui_user: @user) && @version_presigned.valid_resource? @version_presigned.download(resource: res) else render plain: 'Download for this version of the dataset is unavailable', status: 404