소스 검색

fix nil pointer if group not exists (#1773)

Co-authored-by: anqiansong <anqiansong@bytedance.com>
anqiansong 3 년 전
부모
커밋
252fabcc4b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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()
 			}
 		}