Skip to content

Commit 1afe9bb

Browse files
committed
fix: matches check
1 parent c874f16 commit 1afe9bb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

internal/util/target_match.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ func NewTargetMatcher() *TargetMatcher {
5353
}
5454

5555
func (m *TargetMatcher) ResetMatches() {
56+
if m == nil {
57+
return
58+
}
59+
5660
for _, t := range m.matchers {
5761
t.matched = 0
5862
}

pkg/actions/deploy.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ type DeployOptions struct {
7777
}
7878

7979
func NewDeploy(log logger.Logger, cfg *config.Project, opts *DeployOptions) *Deploy {
80+
// Ensure Targets and Skips are never nil
81+
if opts.Targets == nil {
82+
opts.Targets = util.NewTargetMatcher()
83+
}
84+
if opts.Skips == nil {
85+
opts.Skips = util.NewTargetMatcher()
86+
}
87+
8088
return &Deploy{
8189
log: log,
8290
cfg: cfg,

0 commit comments

Comments
 (0)