diff --git a/src/main/java/run/halo/app/handler/file/LocalFileHandler.java b/src/main/java/run/halo/app/handler/file/LocalFileHandler.java index 6e6b53634..bbfeb39b4 100644 --- a/src/main/java/run/halo/app/handler/file/LocalFileHandler.java +++ b/src/main/java/run/halo/app/handler/file/LocalFileHandler.java @@ -187,7 +187,7 @@ public class LocalFileHandler implements FileHandler { // Delete the file key try { - Files.delete(path); + Files.deleteIfExists(path); } catch (IOException e) { throw new FileOperationException("附件 " + key + " 删除失败", e); }