jhump / protoreflect

Reflection (Rich Descriptors) for Go Protocol Buffers
Apache License 2.0
1.35k stars 172 forks source link

NPE from sourceinfo wrapping logic #618

Closed Alfus closed 2 months ago

Alfus commented 2 months ago

Some methods to find descriptors return nil instead of a NotFound error. All the wrapping functions should pass nil through instead of wrapping it. For example, if a field is not found, nil is normally returned, but from a wrapped message descriptor, a wrapped nil is return, which eventually causes a NPE if used.