mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 00:08:51 -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:
parent
507e1c5df9
commit
b48da1a48c
@ -32,7 +32,7 @@ public class UserFiles {
|
|||||||
|
|
||||||
public static void trash(File file) throws IOException {
|
public static void trash(File file) throws IOException {
|
||||||
// use system trash if possible
|
// 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 {
|
try {
|
||||||
if (Desktop.getDesktop().moveToTrash(file)) {
|
if (Desktop.getDesktop().moveToTrash(file)) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user