diff --git a/core/src/main/java/tech/pegasys/web3signer/core/Runner.java b/core/src/main/java/tech/pegasys/web3signer/core/Runner.java index 0d8390f33..6abf5b1e1 100644 --- a/core/src/main/java/tech/pegasys/web3signer/core/Runner.java +++ b/core/src/main/java/tech/pegasys/web3signer/core/Runner.java @@ -112,7 +112,7 @@ public void run() { healthCheckHandler = HealthCheckHandler.create(vertx); final List artifactSignerProvider = - createArtifactSignerProvider(vertx, metricsSystem); + Optional.ofNullable(createArtifactSignerProvider(vertx, metricsSystem)).orElse(List.of()); try { createVersionMetric(metricsSystem); @@ -183,9 +183,7 @@ public void run() { closeables.add(() -> shutdownVertx(vertx)); } catch (final Throwable e) { - if (artifactSignerProvider != null) { - artifactSignerProvider.forEach(ArtifactSignerProvider::close); - } + artifactSignerProvider.forEach(ArtifactSignerProvider::close); shutdownVertx(vertx); metricsService.ifPresent(MetricsService::stop); LOG.error("Failed to initialise application", e);