From 252fabcc4b0c49b5293845737ab8abf93bf4efda Mon Sep 17 00:00:00 2001 From: anqiansong Date: Sat, 9 Apr 2022 11:54:30 +0800 Subject: [PATCH] fix nil pointer if group not exists (#1773) Co-authored-by: anqiansong --- tools/goctl/api/parser/g4/ast/apiparser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/goctl/api/parser/g4/ast/apiparser.go b/tools/goctl/api/parser/g4/ast/apiparser.go index b19ba666..89aadb0d 100644 --- a/tools/goctl/api/parser/g4/ast/apiparser.go +++ b/tools/goctl/api/parser/g4/ast/apiparser.go @@ -253,7 +253,7 @@ func (p *Parser) duplicateRouteCheck(nestedApi *Api, mainHandlerMap, mainRouteMa prefix = p.Text() } g := each.AtServer.Kv.Get(groupKey) - if p != nil { + if g != nil { group = g.Text() } }