Skip to content

Commit

Permalink
fix: fix unknown nil ptr issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyJavaBean committed Jun 12, 2024
1 parent 3e01808 commit b968ccb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion validator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
)

const (
Version = "v0.2.4"
Version = "v0.2.5"
)

var ValidMethodName string = "IsValid"
Expand Down Expand Up @@ -181,6 +181,9 @@ func (g *generator) renderHeader(ast *tp.Thrift) (string, error) {
rootScope := g.utils.RootScope()
if rootScope != nil {
for _, inc := range rootScope.Includes() {
if inc == nil {
continue
}
if inc.ImportPath == impt {
if inc.PackageName == filepath.Base(inc.ImportPath) {
importAlias = inc.PackageName + " "
Expand Down

0 comments on commit b968ccb

Please sign in to comment.