Skip to content

Commit

Permalink
Check for empty string (#128)
Browse files Browse the repository at this point in the history
Only add the projectRoot condition if the subdir is non-nil and also not
an empty string, otherwise the search doesn't return any stacks.
  • Loading branch information
bodgit authored Jul 25, 2023
1 parent 0b9ce9b commit 35f7028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cmd/stack/open_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func searchStacks(ctx context.Context, p *stackSearchParams) ([]stack, error) {
},
}

if p.projectRoot != nil {
if p.projectRoot != nil && *p.projectRoot != "" {
root := strings.TrimSuffix(*p.projectRoot, "/")
conditions = append(conditions, structs.QueryPredicate{
Field: graphql.String("projectRoot"),
Expand Down

0 comments on commit 35f7028

Please sign in to comment.