browse file directory exception

This commit is contained in:
MeexReay 2024-04-22 13:28:45 +03:00
parent 38dad10048
commit efcc61b578

View File

@ -103,10 +103,14 @@ public class RecordWidget implements Drawable, Widget {
ButtonWidget export_button = ButtonWidget.builder(Text.translatable("text.repeating-mod.export"), (i) -> { ButtonWidget export_button = ButtonWidget.builder(Text.translatable("text.repeating-mod.export"), (i) -> {
if (Desktop.isDesktopSupported()) { if (Desktop.isDesktopSupported()) {
Desktop desk = Desktop.getDesktop(); Desktop desk = Desktop.getDesktop();
try {
desk.browseFileDirectory(record.getFile());
} catch (Exception e) {
try { try {
desk.browse(record.getFile().toURI()); desk.browse(record.getFile().toURI());
} catch (IOException e) { } catch (IOException ex) {
throw new RuntimeException(e); throw new RuntimeException(ex);
}
} }
} }
}).dimensions(parent.getX() + getX() + 77,parent.getY() + getY() + 4 + 14, 38, 13).build(); }).dimensions(parent.getX() + getX() + 77,parent.getY() + getY() + 4 + 14, 38, 13).build();