Fix some NPEs

This commit is contained in:
crschnick
2025-05-01 05:36:05 +00:00
parent b5093418d4
commit 31d07693bb
2 changed files with 10 additions and 1 deletions

View File

@@ -47,6 +47,10 @@ public class BrowserFileSystemHelper {
return null;
}
if (model.getFileSystem() == null) {
return path;
}
var shell = model.getFileSystem().getShell();
if (shell.isEmpty() || !shell.get().isRunning(true)) {
return path;

View File

@@ -43,8 +43,13 @@ public class BrowserOverviewComp extends SimpleComp {
var common = sc.getOsType().determineInterestingPaths(sc).stream()
.map(s -> FileEntry.ofDirectory(model.getFileSystem(), s))
.filter(entry -> {
var fs = model.getFileSystem();
if (fs == null) {
return false;
}
try {
return model.getFileSystem().directoryExists(entry.getPath());
return fs.directoryExists(entry.getPath());
} catch (Exception e) {
ErrorEvent.fromThrowable(e).handle();
return false;