Various small fixes

This commit is contained in:
crschnick committed 2026-10-06 14:12:39 +00:00
1 parent ec06b57404
commit 0b231b7666
8 files changed
+21 -15

No files matched your search

@@ -69,7 +69,7 @@ public class ActionUrls {
var query = splitQuery(queryString);
var id = query.get("id");
if (id == null || id.size() != 1) {
if (id == null || id.size() != 1 || id.getFirst() == null) {
return Optional.empty();
}
@@ -172,10 +172,6 @@ public class WrapperFileSystem implements FileSystem {
@Override
public boolean requiresReinit() {
if (!runningCheck.get()) {
return false;
}
return fs.requiresReinit();
}
@@ -217,6 +217,7 @@ public class StoreChoicePopover<T extends DataStore> {
var r = listStack.build();
var content = new VBox(top, r);
content.setSpacing(6);
content.setFillWidth(true);
content.getStyleClass().add("choice-comp-content");
content.setPrefWidth(480);
@@ -84,6 +84,22 @@ public class ErrorEventFactory {
return formatThrowableMessage(ite.getCause());
}
if (t instanceof ExceptionInInitializerError eiie && eiie.getCause() != null && eiie.getCause() != t) {
return "Failed to initialize class: " + formatThrowableMessage(eiie.getCause());
}
if (t instanceof ClassNotFoundException && t.getMessage() != null) {
return "Class not found: " + t.getMessage();
}
if (t instanceof NoClassDefFoundError && t.getMessage() != null) {
if (t.getMessage().startsWith("Could not initialize class")) {
return t.getMessage();
}
return "Class definition not found: " + t.getMessage().replace('/', '.');
}
if (t.getMessage() == null) {
return AppI18n.get("errorTypeOccurred", t.getClass().getSimpleName());
}
@@ -95,7 +95,7 @@ public class TerminalLauncherManager {
req = entries.get(request);
}
if (req != null && req.getShellPid() != -1) {
if (req != null && req.getShellPid() != -1 && req.getShellPid() != 0) {
ProcessHandle current = ProcessHandle.of(pid).orElseThrow(() -> new BeaconClientException("Unknown process " + pid));
while ((current = current.parent().orElse(null)) != null) {
if (current.pid() == req.getShellPid()) {
@@ -49,12 +49,4 @@ public class IniFile {
}
return kv.get(key);
}
public String getOrDefault(String section, String key, String defaultvalue) {
Map<String, String> kv = entries.get(section);
if (kv == null) {
return defaultvalue;
}
return kv.get(key);
}
}
@@ -211,6 +211,7 @@ public class SshLocalBridge {
var file = AppSystemInfo.ofCurrent().getUserHome().resolve(".ssh", "config");
if (!Files.exists(file)) {
Files.createDirectories(file.getParent());
Files.writeString(file, hostEntry);
return;
}
@@ -61,7 +61,7 @@ public abstract class RemoteViewerVncClient implements ExternalVncClient {
}
var name = OsFileSystem.ofLocal().makeFileSystemCompatible(configuration.getTitle());
var file = AppLocalTemp.getLocalTempDataDirectory("vnc").resolve(name + ".vv");
var file = AppLocalTemp.getLocalTempDataDirectory("spice").resolve(name + ".vv");
Files.writeString(file, vv.toString());
return file;
}