Browse Source

fix nil pointer if group not exists (#1773)

Co-authored-by: anqiansong <anqiansong@bytedance.com>
anqiansong 3 years ago
parent
commit
252fabcc4b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/goctl/api/parser/g4/ast/apiparser.go

+ 1 - 1
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()
 			}
 		}