Issue #11944 - Part.delete() should only attempt to delete if the file exists.

This commit is contained in:
Joakim Erdfelt 2024-06-21 13:40:06 -05:00
parent b15cfd125d
commit 9f077aaeb3
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 2 additions and 2 deletions

View File

@ -306,7 +306,7 @@ public class MultiPart
Path path = getPath();
if (path != null)
{
Files.delete(path);
Files.deleteIfExists(path);
try (AutoLock ignored = lock.lock())
{
this.path = null;
@ -338,7 +338,7 @@ public class MultiPart
if (source != null)
source.fail(t);
if (path != null)
Files.delete(path);
Files.deleteIfExists(path);
}
catch (Throwable x)
{