We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0fdf1e commit c79194bCopy full SHA for c79194b
1 file changed
internal/fields/model.go
@@ -108,8 +108,11 @@ func (fds *FieldDefinitions) UnmarshalYAML(value *yaml.Node) error {
108
return nil
109
case yaml.MappingNode:
110
// Fields are defined as a map, this happens in ecs fields files.
111
+ if len(value.Content)%2 != 0 {
112
+ return fmt.Errorf("pairs of key-values expected in map")
113
+ }
114
var fields []FieldDefinition
- for i := 0; i < len(value.Content); i += 2 {
115
+ for i := 0; i+1 < len(value.Content); i += 2 {
116
key := value.Content[i]
117
value := value.Content[i+1]
118
0 commit comments