From 34bef65d31b2814e9a5345041e33ec6a5eebdbb4 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:55:23 -0700 Subject: [PATCH] fix(cloud-paper-signed-arguments): Handle case where signing is disabled fixes #86 --- .../org/incendo/cloud/paper/signed/PaperSignedMapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloud-paper-signed-arguments/src/main/java/org/incendo/cloud/paper/signed/PaperSignedMapper.java b/cloud-paper-signed-arguments/src/main/java/org/incendo/cloud/paper/signed/PaperSignedMapper.java index 8b3a0103..8d3b62a2 100644 --- a/cloud-paper-signed-arguments/src/main/java/org/incendo/cloud/paper/signed/PaperSignedMapper.java +++ b/cloud-paper-signed-arguments/src/main/java/org/incendo/cloud/paper/signed/PaperSignedMapper.java @@ -95,8 +95,11 @@ public CompletableFuture> apply( } catch (final Throwable thr) { return ArgumentParseResult.successFuture(SignedString.unsigned(str)); } + if (signedArgs.isEmpty()) { + return ArgumentParseResult.successFuture(SignedString.unsigned(str)); + } if (signedArgs.size() != 1) { - throw new IllegalStateException(); + throw new IllegalStateException("Found more signed arguments than expected (" + signedArgs.size() + ")"); } return ArgumentParseResult.successFuture( new SignedStringImpl(