Skip to content

Commit

Permalink
fix nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Aug 18, 2024
1 parent c20f297 commit 52e8271
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ func (def Pattern) httpRequestReceiverTemplateHandlerFunc(templatesVariableName
}

func (def Pattern) matchReceiver(funcDecl *ast.FuncDecl, receiverTypeIdent string) bool {
if funcDecl == nil || funcDecl.Name == nil || funcDecl.Name.Name != def.fun.Name || funcDecl.Recv == nil && len(funcDecl.Recv.List) < 1 {
if funcDecl == nil || funcDecl.Name == nil || funcDecl.Name.Name != def.fun.Name ||
funcDecl.Recv == nil || len(funcDecl.Recv.List) < 1 {
return false
}
exp := funcDecl.Recv.List[0].Type
Expand Down

0 comments on commit 52e8271

Please sign in to comment.