Fix possible NPEs

This commit is contained in:
crschnick
2024-01-15 15:11:35 +00:00
parent 45d3d40c6f
commit eef19677ab
@@ -102,6 +102,9 @@ public class XPipeUrlAction implements ActionProvider {
var entry = DataStorage.get()
.getStoreEntryIfPresent(UUID.fromString(args.get(1)))
.orElseThrow();
if (!entry.getValidity().isUsable()) {
return null;
}
return new LaunchAction(entry);
}
case "action" -> {
@@ -112,6 +115,9 @@ public class XPipeUrlAction implements ActionProvider {
var entry = DataStorage.get()
.getStoreEntryIfPresent(UUID.fromString(args.get(2)))
.orElseThrow();
if (!entry.getValidity().isUsable()) {
return null;
}
return new CallAction(provider, entry);
}
default -> {