Skip to content

Commit

Permalink
Update operation.go (#1753)
Browse files Browse the repository at this point in the history
getUnderlyingSchema can return nil, so it has to be checked here otherwise the code is exposed to invalid memory address or nil pointer dereference
  • Loading branch information
mathieu-chauvet authored Feb 6, 2024
1 parent 98ed434 commit 56fde5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ func (operation *Operation) ParseParamComment(commentLine string, astFile *ast.F
if len(itemSchema.Type) == 0 {
itemSchema = operation.parser.getUnderlyingSchema(prop.Items.Schema)
}
if itemSchema == nil {
continue
}
if len(itemSchema.Type) == 0 {
continue
}
Expand Down

0 comments on commit 56fde5c

Please sign in to comment.