Skip to content

fix: add defensive checks in handleAssociate to prevent panics#114

Merged
thinkgos merged 1 commit into
things-go:masterfrom
backplane:fix-handleassociate-panic-safety
Mar 25, 2026
Merged

fix: add defensive checks in handleAssociate to prevent panics#114
thinkgos merged 1 commit into
things-go:masterfrom
backplane:fix-handleassociate-panic-safety

Conversation

@actualben

Copy link
Copy Markdown
Contributor
  • Add missing return after ResolveUDPAddr failure, preventing subsequent call to ListenUDP with nil address
  • Use checked type assertion for LocalAddr.(*net.TCPAddr) to handle non-TCP connections gracefully
  • Use checked type assertion when retrieving connections from sync.Map to prevent panic on unexpected types

- Add missing return after ResolveUDPAddr failure, preventing
  subsequent call to ListenUDP with nil address
- Use checked type assertion for LocalAddr.(*net.TCPAddr) to handle
  non-TCP connections gracefully
- Use checked type assertion when retrieving connections from sync.Map
  to prevent panic on unexpected types
@thinkgos thinkgos merged commit 562cd19 into things-go:master Mar 25, 2026
@actualben actualben deleted the fix-handleassociate-panic-safety branch June 10, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants