-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: Should check if the reply is null value #4219
Comments
Do you have a concrete use case where you cannot return an empty message and |
The point is not whether it valid or not. It cannot be therefore panic. So, we don't need a use case, we just need to fix the panic in the stack. |
Can you provide the client/server code to reproduce? Also, this might have been fixed by #4218 |
Unfortunately, there is no nil judgment for vv in this modification: grpc-go/encoding/proto/proto.go Line 41 in 9dfe677
If vv == nil, will panic. |
This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
p2 |
Can you please provide the client/server code, so we can investigate how it happens? |
Where would the panic occur in this case? If |
See:
grpc-go/server.go
Line 1252 in 26c143b
The reply parameter does not check if it is nil value.
If nil is returned in the server-side handler code and there are no errors, it will be panic:
Instead of checking the interface itself, you should check whether the interface's pointing value is nil, for example:
The text was updated successfully, but these errors were encountered: