Skip to content

Commit

Permalink
fix(no-release): nil resources (#486)
Browse files Browse the repository at this point in the history
* added edge case on serializer of having nested nil resources

Signed-off-by: dn <dn@nuvotex.de>

* Fix the loop statement

---------

Signed-off-by: dn <dn@nuvotex.de>
Co-authored-by: Vaerh <vaerh@tutanota.com>
  • Loading branch information
danielnachtrub and vaerh committed Jun 27, 2024
1 parent 6bb0fdd commit 8571dea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions routeros/mikrotik_serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ func TerraformResourceDataToMikrotik(s map[string]*schema.Schema, d *schema.Reso

case *schema.Resource:

// skip if object is empty
if value.([]interface{})[0] == nil {
continue
}

list := value.([]interface{})[0].(map[string]interface{})
ctyList := rawConfig.GetAttr(terraformSnakeName).AsValueSlice()[0]

Expand Down

0 comments on commit 8571dea

Please sign in to comment.