From e338fed9d7c2d3289b492e0607e2b85aec588571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sun, 6 Jun 2021 13:40:47 +0200 Subject: [PATCH] Catch errors per file since some may error in `isHidden`, e.g., so just skip those. --- .../cil/oc2/client/gui/FileChooserScreen.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/li/cil/oc2/client/gui/FileChooserScreen.java b/src/main/java/li/cil/oc2/client/gui/FileChooserScreen.java index c8979f4e..470e1d9f 100644 --- a/src/main/java/li/cil/oc2/client/gui/FileChooserScreen.java +++ b/src/main/java/li/cil/oc2/client/gui/FileChooserScreen.java @@ -290,14 +290,17 @@ public class FileChooserScreen extends Screen { }) .collect(Collectors.toList()); for (final Path path : files) { - if (Files.isHidden(path)) { - continue; - } + try { + if (Files.isHidden(path)) { + continue; + } - if (Files.isDirectory(path)) { - addEntry(createDirectoryEntry(path)); - } else { - addEntry(createFileEntry(path)); + if (Files.isDirectory(path)) { + addEntry(createDirectoryEntry(path)); + } else { + addEntry(createFileEntry(path)); + } + } catch (final IOException | SecurityException ignored) { } } } catch (final IOException | SecurityException e) {