1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-22 07:48:52 -05:00

Make sure to avoid java.awt.HeadlessException if Desktop.moveToTrash() is called on headless Linux devices (possible issue breaking -revert on some Linux devices)

This commit is contained in:
Reinhard Pointner 2018-09-20 20:39:53 +07:00
parent 507e1c5df9
commit b48da1a48c

View File

@ -32,7 +32,7 @@ public class UserFiles {
public static void trash(File file) throws IOException {
// use system trash if possible
if (Desktop.getDesktop().isSupported(Desktop.Action.MOVE_TO_TRASH)) {
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.MOVE_TO_TRASH)) {
try {
if (Desktop.getDesktop().moveToTrash(file)) {
return;