From 47d2089da14da8705f73bde0de801b77d60e85d3 Mon Sep 17 00:00:00 2001 From: Peter Karman Date: Thu, 14 May 2020 17:30:52 -0500 Subject: [PATCH] shots in the dark --- app/services/pdf_service.rb | 2 +- app/services/zipfile_creator.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/pdf_service.rb b/app/services/pdf_service.rb index 3a9d327a6..ab7152b79 100644 --- a/app/services/pdf_service.rb +++ b/app/services/pdf_service.rb @@ -14,7 +14,7 @@ def self.write(filename, contents, pdf_attributes) # pdftk will crash on corrupt PDFs with the "Error: Unable to find file"; # if this happens, write the file without attributes - unless stderr.empty? + unless stderr.blank? # contents might come back as nil Rails.logger.warn("cannot write pdf of size #{contents.try(:size).to_i} via #{command}: #{stderr}") File.open(filename, "wb") do |f| diff --git a/app/services/zipfile_creator.rb b/app/services/zipfile_creator.rb index 1cc2f20d6..18b35e268 100644 --- a/app/services/zipfile_creator.rb +++ b/app/services/zipfile_creator.rb @@ -7,7 +7,7 @@ class ZipfileCreator def process records = manifest.records - return if records.empty? + return if records.blank? t = Tempfile.new write_to_tempfile(t, records)