diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java index 6d0c27849..45b9ceae4 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java @@ -189,10 +189,10 @@ public final class BrowserFileListComp extends SimpleComp { var m = fileList.getFileSystemModel(); var user = unix.getUser() != null ? unix.getUser() - : m.getCache().getUsers().get(unix.getUid()); + : m.getCache().getUsers().getOrDefault(unix.getUid(), "?"); var group = unix.getGroup() != null ? unix.getGroup() - : m.getCache().getGroups().get(unix.getGid()); + : m.getCache().getGroups().getOrDefault(unix.getGid(), "?"); var uid = String.valueOf( unix.getUid() != null ? unix.getUid() : m.getCache().getUidForUser(user)); var gid = String.valueOf( diff --git a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java index 66ac5a467..d936992cf 100644 --- a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java +++ b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemCache.java @@ -58,7 +58,9 @@ public class OpenFileSystemCache extends ShellControlCache { .orElse(""); lines.lines().forEach(s -> { var split = s.split(":"); - users.putIfAbsent(Integer.parseInt(split[2]), split[0]); + try { + users.putIfAbsent(Integer.parseInt(split[2]), split[0]); + } catch (NumberFormatException ignored) {} }); if (users.isEmpty()) { @@ -77,7 +79,9 @@ public class OpenFileSystemCache extends ShellControlCache { .orElse(""); lines.lines().forEach(s -> { var split = s.split(":"); - groups.putIfAbsent(Integer.parseInt(split[2]), split[0]); + try { + groups.putIfAbsent(Integer.parseInt(split[2]), split[0]); + } catch (NumberFormatException ignored) {} }); if (groups.isEmpty()) {