From feca9026adbcb1c55484e96b6de5fdbc5a4d3818 Mon Sep 17 00:00:00 2001 From: Miguel Prieto Date: Wed, 9 Oct 2024 10:47:11 -0300 Subject: [PATCH] Added a null check for credentials during build time. This is a common mistake when getting these values from env variables for example. --- .../src/main/java/io/orkes/conductor/client/ApiClient.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conductor-clients/java/conductor-java-sdk/orkes-client/src/main/java/io/orkes/conductor/client/ApiClient.java b/conductor-clients/java/conductor-java-sdk/orkes-client/src/main/java/io/orkes/conductor/client/ApiClient.java index c7b8d449d..3d1ef30c5 100644 --- a/conductor-clients/java/conductor-java-sdk/orkes-client/src/main/java/io/orkes/conductor/client/ApiClient.java +++ b/conductor-clients/java/conductor-java-sdk/orkes-client/src/main/java/io/orkes/conductor/client/ApiClient.java @@ -150,6 +150,10 @@ public static ApiClientBuilder builder() { public static class ApiClientBuilder extends Builder { public ApiClientBuilder credentials(String key, String secret) { + if (key == null || secret == null) { + throw new IllegalArgumentException("Key and secret must not be null"); + } + this.addHeaderSupplier(new OrkesAuthentication(key, secret)); return this; }