Skip to content

Commit

Permalink
fix(cli): prevent NPE on profiles + @NotNull on CheckStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Oct 1, 2024
1 parent 1297171 commit 7359172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/dbt/cli/DbtCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/kestra/plugin/dbt/cloud/CheckStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -69,6 +70,7 @@ public class CheckStatus extends AbstractDbtCloud implements RunnableTask<CheckS
@Schema(
title = "The job run ID to check the status for."
)
@NotNull
Property<String> runId;


Expand Down

0 comments on commit 7359172

Please sign in to comment.