Skip to content

Commit

Permalink
Makre sure ArtifactSignerProvider list is non null
Browse files Browse the repository at this point in the history
  • Loading branch information
usmansaleem committed Oct 16, 2024
1 parent 373a523 commit 9c7a565
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/main/java/tech/pegasys/web3signer/core/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void run() {
healthCheckHandler = HealthCheckHandler.create(vertx);

final List<ArtifactSignerProvider> artifactSignerProvider =
createArtifactSignerProvider(vertx, metricsSystem);
Optional.ofNullable(createArtifactSignerProvider(vertx, metricsSystem)).orElse(List.of());

try {
createVersionMetric(metricsSystem);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9c7a565

Please sign in to comment.