Skip to content

Commit 84ea425

Browse files
Suppress file deletion error
1 parent b67583b commit 84ea425

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ private static File convertWithFfmpeg(File file) throws MediaException {
408408
ProcessHelper.executeCommand(buildFfmpegCommand(baseCommand, "-pass", "1", "-f", "webm", IS_WINDOWS ? "NUL" : "/dev/null"));
409409
ProcessHelper.executeCommand(buildFfmpegCommand(baseCommand, "-pass", "2", webmVideo.getAbsolutePath()));
410410
} catch (ProcessException e) {
411-
deleteFile(webmVideo);
411+
try {
412+
deleteFile(webmVideo);
413+
} catch (FileOperationException ex) {
414+
e.addSuppressed(ex);
415+
}
412416
throw new MediaException(e.getMessage());
413417
} finally {
414418
deleteLogFile(logPrefix);

0 commit comments

Comments
 (0)