diff --git a/R/S2_download.R b/R/S2_download.R index d3c320b..f8bc9be 100644 --- a/R/S2_download.R +++ b/R/S2_download.R @@ -102,10 +102,10 @@ S2_download = function(url, destfile, zip = TRUE, skipExisting = TRUE, progressB success[i] = TRUE }, warning = function(w) { - if (file.exists(destfile[i])) { - unlink(destfile[i]) - } if (all(w$message == 'Operation was aborted by an application callback')) { + if (file.exists(destfile[i])) { + unlink(destfile[i]) + } breakLoop <<- TRUE } },