From 73591723d8a57821769665282967c61bf3fb77bd Mon Sep 17 00:00:00 2001 From: "brian.mulier" Date: Tue, 1 Oct 2024 21:14:00 +0200 Subject: [PATCH] fix(cli): prevent NPE on profiles + @NotNull on CheckStatus --- src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java | 2 +- src/main/java/io/kestra/plugin/dbt/cloud/CheckStatus.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java b/src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java index 549503e..6640268 100644 --- a/src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java +++ b/src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java @@ -250,7 +250,7 @@ public void accept(String line, Boolean isStdErr) { Path projectWorkingDirectory = projectDir == null ? commands.getWorkingDirectory() : commands.getWorkingDirectory().resolve(projectDir.as(runContext, String.class)); - String profilesString = profiles.as(runContext, String.class); + String profilesString = profiles == null ? null : profiles.as(runContext, String.class); if (profilesString != null && !profilesString.isEmpty()) { var profileFile = new File(commands.getWorkingDirectory().toString(), "profiles.yml"); if (profileFile.exists()) { diff --git a/src/main/java/io/kestra/plugin/dbt/cloud/CheckStatus.java b/src/main/java/io/kestra/plugin/dbt/cloud/CheckStatus.java index 0a17802..50e4dbe 100644 --- a/src/main/java/io/kestra/plugin/dbt/cloud/CheckStatus.java +++ b/src/main/java/io/kestra/plugin/dbt/cloud/CheckStatus.java @@ -16,6 +16,7 @@ import io.micronaut.http.HttpRequest; import io.micronaut.http.uri.UriTemplate; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.*; import lombok.experimental.SuperBuilder; import org.slf4j.Logger; @@ -69,6 +70,7 @@ public class CheckStatus extends AbstractDbtCloud implements RunnableTask runId;