socket-controllers icon indicating copy to clipboard operation
socket-controllers copied to clipboard

fix: Cannot read property 'filter' of undefined

Open alexgev opened this issue 4 years ago • 3 comments
trafficstars

Fixes

Description

if controllers array is empty or undefined i have error "Cannot read property 'filter' of undefined"

Checklist

  • [x] the pull request title describes what this PR does (not a vague title like Update index.md)
  • [x] the pull request targets the default branch of the repository (develop)
  • [x] the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • [x] tests are added for the changes I made (if any source code was modified)
  • [ ] documentation added or updated
  • [ ] I have run the project locally and verified that there are no errors

Fixes

fixes #216

alexgev avatar Mar 23 '21 17:03 alexgev

Hi!

Thanks for the PR, please add a test case for this as well, so we know it won' be re-introduced later.

NoNameProvided avatar Mar 24 '21 08:03 NoNameProvided

Hi! Glad to be of service. Tests have been added.

alexgev avatar Mar 24 '21 18:03 alexgev

Hey everyone, was this ever fixed? I'm getting the same error still when calling useSocketServer without the controllers array.

Blargian avatar Nov 06 '21 18:11 Blargian

@alexgev Sorry for the late action on this. I've included your fix and test in another PR. Thanks again!

attilaorosz avatar Dec 20 '22 17:12 attilaorosz

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jan 20 '23 01:01 github-actions[bot]