Issue #11944 - Part.delete() should only attempt to delete if the file exists.
This commit is contained in:
parent
b15cfd125d
commit
9f077aaeb3
|
@ -306,7 +306,7 @@ public class MultiPart
|
||||||
Path path = getPath();
|
Path path = getPath();
|
||||||
if (path != null)
|
if (path != null)
|
||||||
{
|
{
|
||||||
Files.delete(path);
|
Files.deleteIfExists(path);
|
||||||
try (AutoLock ignored = lock.lock())
|
try (AutoLock ignored = lock.lock())
|
||||||
{
|
{
|
||||||
this.path = null;
|
this.path = null;
|
||||||
|
@ -338,7 +338,7 @@ public class MultiPart
|
||||||
if (source != null)
|
if (source != null)
|
||||||
source.fail(t);
|
source.fail(t);
|
||||||
if (path != null)
|
if (path != null)
|
||||||
Files.delete(path);
|
Files.deleteIfExists(path);
|
||||||
}
|
}
|
||||||
catch (Throwable x)
|
catch (Throwable x)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue