File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2877,9 +2877,12 @@ func buildDatadogBodyFiles(attr []interface{}) []datadogV1.SyntheticsTestRequest
2877
2877
func buildTerraformBodyFiles (actualBodyFiles * []datadogV1.SyntheticsTestRequestBodyFile , oldLocalBodyFiles []map [string ]interface {}) (localBodyFiles []map [string ]interface {}) {
2878
2878
localBodyFiles = make ([]map [string ]interface {}, len (* actualBodyFiles ))
2879
2879
for i , file := range * actualBodyFiles {
2880
- // The file content is kept from the existing localFile from the state,
2881
- // as the response from the backend contains the bucket key rather than the content.
2882
- localFile := oldLocalBodyFiles [i ]
2880
+ localFile := make (map [string ]interface {})
2881
+ if i < len (oldLocalBodyFiles ) && oldLocalBodyFiles [i ] != nil {
2882
+ // The file content is kept from the existing localFile from the state,
2883
+ // as the response from the backend contains the bucket key rather than the content.
2884
+ localFile = oldLocalBodyFiles [i ]
2885
+ }
2883
2886
localFile ["name" ] = file .GetName ()
2884
2887
localFile ["original_file_name" ] = file .GetOriginalFileName ()
2885
2888
localFile ["type" ] = file .GetType ()
You can’t perform that action at this time.
0 commit comments