From e7fc5a2eb9b812f922fb0518aa1571ee1c51d1ce Mon Sep 17 00:00:00 2001 From: hartator Date: Wed, 10 Aug 2016 14:32:41 -0500 Subject: [PATCH] Fix case when file wasn't created --- lib/wayback_machine_downloader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wayback_machine_downloader.rb b/lib/wayback_machine_downloader.rb index 3727016..bb6b18a 100644 --- a/lib/wayback_machine_downloader.rb +++ b/lib/wayback_machine_downloader.rb @@ -171,7 +171,7 @@ class WaybackMachineDownloader rescue StandardError => e puts "#{file_url} # #{e}" ensure - if File.size(file_path) == 0 and not @all + if not @all and File.exists?(file_path) and File.size(file_path) == 0 File.delete(file_path) puts "#{file_path} was empty and was removed." end