Skip to content

Commit f116924

Browse files
committed
fix: Avoid assignment to nil map in mock provider during WriteStateBytes
1 parent a3bd371 commit f116924

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/providers/testing/provider_mock.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ func (p *MockProvider) WriteStateBytes(r providers.WriteStateBytesRequest) (resp
361361

362362
// If we haven't already, record in the mock that
363363
// the matching workspace exists
364+
if p.MockStates == nil {
365+
p.MockStates = make(map[string]interface{})
366+
}
364367
p.MockStates[r.StateId] = true
365368

366369
return p.WriteStateBytesResponse

0 commit comments

Comments
 (0)