mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix owner info NPEs
This commit is contained in:
parent
2831e8372a
commit
3a700643f0
2 changed files with 8 additions and 4 deletions
|
@ -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(
|
||||
|
|
|
@ -58,7 +58,9 @@ public class OpenFileSystemCache extends ShellControlCache {
|
|||
.orElse("");
|
||||
lines.lines().forEach(s -> {
|
||||
var split = s.split(":");
|
||||
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(":");
|
||||
try {
|
||||
groups.putIfAbsent(Integer.parseInt(split[2]), split[0]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
});
|
||||
|
||||
if (groups.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue