diff --git a/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java b/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java index ad03bcd550a..1d0ec0f19d9 100644 --- a/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java +++ b/src/main/java/edu/harvard/iq/dataverse/datasetutility/AddReplaceFileHelper.java @@ -1666,7 +1666,7 @@ private boolean step_070_run_update_dataset_command() { } } - if (isFileReplaceOperation() && !multifile) { + if (isFileReplaceOperation() && deleteFileId!=-1 && !multifile) { // Finalize the delete of the physical file // (File service will double-check that the datafile no // longer exists in the database, before proceeding to