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:
parent
507e1c5df9
commit
b48da1a48c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user