From 3bac343bba565ee6365fd8efcfa03d980d1681b0 Mon Sep 17 00:00:00 2001 From: courtneyeh Date: Thu, 9 Nov 2023 15:05:46 +1100 Subject: [PATCH] Check conditions and throw error --- .../tech/pegasys/teku/cli/options/ValidatorKeysOptions.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java b/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java index f551279bf25..41a7ad9dff8 100644 --- a/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java +++ b/teku/src/main/java/tech/pegasys/teku/cli/options/ValidatorKeysOptions.java @@ -134,10 +134,10 @@ public void configure(TekuConfiguration.Builder builder) { } private List parseValidatorExternalKeys(final boolean allowNoLoadedKeys) { - if (allowNoLoadedKeys) { - return validatorExternalSignerPublicKeys.stream().filter(StringUtils::isNotBlank).toList(); + if (!allowNoLoadedKeys && validatorExternalSignerPublicKeys.isEmpty()) { + throw new InvalidConfigurationException("No validator external signer keys are loaded"); } - return validatorExternalSignerPublicKeys; + return validatorExternalSignerPublicKeys.stream().filter(StringUtils::isNotBlank).toList(); } private URL parseValidatorExternalSignerUrl() {