Skip to content

Commit 8209b2e

Browse files
committed
Fix: avoid nil pointer errors by returning an empty collection of locks when there is no state
1 parent db3bd03 commit 8209b2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/command/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ func (c *InitCommand) getProvidersFromState(ctx context.Context, state *states.S
929929

930930
if state == nil {
931931
// if there is no state there are no providers to get
932-
return true, nil, nil
932+
return true, depsfile.NewLocks(), nil
933933
}
934934
reqs := state.ProviderRequirements()
935935

0 commit comments

Comments
 (0)