-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
nil pointer on c.BufferLength() #164
Comments
Thanks for opening a new issue. The team has been notified and will review it as soon as possible. |
The buffer is not available when working with UDP, see https://gnet.host/blog/presenting-gnet/#udp |
But still, maybe the doc could be a little clearer, I will update the doc for this. |
Even if it wasn’t available for UDP, causing a panic due to a nil is not a good api experience. Returning an error or even just returning 0 would be more user friendly |
Allowing users to call those invalid functions and get results from them can be misleading, confusing users of gnet, e.g., you get a 0 by calling the |
Describe the bug
In React callback:
To Reproduce
Steps to reproduce the behavior:
Send UDP packet.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8e7ccc]
(scrubbed stack):
Expected behavior
The length of the Buffer, even if 0.
System Info (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: