Skip to content

Commit

Permalink
fix panic on GetServiceType
Browse files Browse the repository at this point in the history
  • Loading branch information
namtzigla committed Apr 13, 2023
1 parent d4632b6 commit af97c42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion generator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ func (s *Service) GetTypeMapping() *persist.TypeMapping {
func (s *Service) GetServiceType() *persist.PersistenceOptions {
if s.Desc.Options != nil && proto.HasExtension(s.Desc.Options, persist.E_ServiceType) {
ext := proto.GetExtension(s.Desc.Options, persist.E_ServiceType)
return ext.(*persist.PersistenceOptions)
switch e := ext.(type) {
case persist.PersistenceOptions:
return &e
default:
return nil
}
}
return nil
}
Expand Down

0 comments on commit af97c42

Please sign in to comment.