Skip to content

Commit a6eab5a

Browse files
committed
Added a nil check and a schema build check
1 parent 1864280 commit a6eab5a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

helpers/parameter_utilities.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ func ConstructParamMapFromDeepObjectEncoding(values []*QueryParam, sch *base.Sch
140140
}
141141
// check if schema has additional properties defined as an array
142142
if sch != nil && sch.AdditionalProperties != nil &&
143-
sch.AdditionalProperties.IsA() &&
144-
slices.Contains(sch.AdditionalProperties.A.Schema().Type, Array) {
145-
props[v.Property] = rawValues
143+
sch.AdditionalProperties.IsA() {
144+
s := sch.AdditionalProperties.A.Schema()
145+
if s != nil &&
146+
slices.Contains(s.Type, Array) {
147+
props[v.Property] = rawValues
148+
}
146149
}
147150

148151
if len(props) == 0 {

0 commit comments

Comments
 (0)