Skip to content

Commit

Permalink
fix: add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed May 30, 2024
1 parent 218602b commit 3d323e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/contemplate/contemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *Contemplate) LookupTypesByType(obj types.Object) []types.Object {
}
case *types.TypeName:
if objectExpr := pkg.LookupExpr(object.Name()); objectExpr != nil {
if objectExprIdent := assume.T[*ast.Ident](objectExpr); objectExprIdent != nil {
if objectExprIdent := assume.T[*ast.Ident](objectExpr); objectExprIdent != nil && objectExprIdent.Obj != nil {
if objectExprDecl := assume.T[*ast.TypeSpec](objectExprIdent.Obj.Decl); objectExprDecl != nil {
if objectExprType, ok := pkg.pkg.TypesInfo.Types[objectExprDecl.Type]; ok {
if objectExprTypeNamed := assume.T[*types.Named](objectExprType.Type); objectExprTypeNamed != nil {
Expand Down

0 comments on commit 3d323e2

Please sign in to comment.