Skip to content

Commit

Permalink
fix: visitor panic when Obj is nil (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored May 20, 2021
1 parent 4155955 commit b626158
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions makezero/makezero.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func (v *visitor) recordNonZeroLengthSlices(node ast.Node) {
if !ok {
return
}
if ident.Obj == nil {
return
}
v.nonZeroLengthSliceDecls[ident.Obj.Decl] = struct{}{}
}

Expand Down

0 comments on commit b626158

Please sign in to comment.