Skip to content

Commit 423f492

Browse files
committed
check if empty stack
1 parent 9dc7980 commit 423f492

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmd/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ func resolveStack(sf *stack.StackFile, branch string, cfg *config.Config) (*stac
4444

4545
s := stacks[selected]
4646

47+
if len(s.Branches) == 0 {
48+
return nil, fmt.Errorf("selected stack %q has no branches", s.DisplayName())
49+
}
50+
4751
// Switch to the top branch of the selected stack so future commands
4852
// resolve unambiguously.
4953
topBranch := s.Branches[len(s.Branches)-1].Branch

0 commit comments

Comments
 (0)