Skip to content

Commit

Permalink
desc/sourceinfo: fix panic when descriptor not found (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
shado1111w authored May 29, 2024
1 parent cb1d268 commit bed9136
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions desc/sourceinfo/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ func (r registry) FindFileByPath(path string) (protoreflect.FileDescriptor, erro

func (r registry) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {
d, err := protoregistry.GlobalFiles.FindDescriptorByName(name)
if !canWrap(d) {
return d, nil
}
if err != nil {
return nil, err
}
if !canWrap(d) {
return d, nil
}
switch d := d.(type) {
case protoreflect.FileDescriptor:
return getFile(d), nil
Expand Down

0 comments on commit bed9136

Please sign in to comment.