Skip to content

Commit 56fde5c

Browse files
Update operation.go (#1753)
getUnderlyingSchema can return nil, so it has to be checked here otherwise the code is exposed to invalid memory address or nil pointer dereference
1 parent 98ed434 commit 56fde5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

operation.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.F
334334
if len(itemSchema.Type) == 0 {
335335
itemSchema = operation.parser.getUnderlyingSchema(prop.Items.Schema)
336336
}
337+
if itemSchema == nil {
338+
continue
339+
}
337340
if len(itemSchema.Type) == 0 {
338341
continue
339342
}

0 commit comments

Comments
 (0)