Skip to content

Commit

Permalink
patched nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Nov 18, 2024
1 parent 35c8f48 commit a251c54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ func (t *Types) registerType(aType *Type) error {
return nil
}
t.mux.Lock()
if len(t.info) == 0 {
t.info = map[reflect.Type]*Type{}
}
t.info[aType.Type] = aType
t.mux.Unlock()

Expand Down

0 comments on commit a251c54

Please sign in to comment.