From 4456a9682a10ad59b7b89a1ba0a20d7196a49381 Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Fri, 24 Mar 2023 16:11:18 +0000 Subject: [PATCH] Check for empty string 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. --- internal/cmd/stack/open_command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/stack/open_command.go b/internal/cmd/stack/open_command.go index d934ba7..0221a8e 100644 --- a/internal/cmd/stack/open_command.go +++ b/internal/cmd/stack/open_command.go @@ -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"),