9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-25 18:19:14 +00:00

Only accept posted console option picking when valid result

This commit is contained in:
CocoTheOwner
2021-09-27 15:26:40 +02:00
parent 734c0a37f7
commit 85fe65612e

View File

@@ -546,7 +546,8 @@ public class VirtualDecreeCommand {
CompletableFuture<String> future = new CompletableFuture<>();
Iris.service(CommandSVC.class).postConsole(future);
try {
return future.get(15, TimeUnit.SECONDS);
String result = future.get(15, TimeUnit.SECONDS);
return validOptions.convert(handler::toStringForce).contains(result) ? result : null;
} catch (InterruptedException | ExecutionException | TimeoutException ignored) {
}