Skip to content
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

Cannot read properties of undefined: localeCompare in LiveViewSettingsButtons #11

Closed
SamsonSmithC opened this issue Aug 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@SamsonSmithC
Copy link
Collaborator

Nickname is undefined for cameras that have yet to be given one. This leads the sorting of cameras in the LiveViewSettingsButtons component to throw an error when using the String.prototype.localeCompare() function on the undefined nickname.

@SamsonSmithC SamsonSmithC added the bug Something isn't working label Aug 19, 2022
@SamsonSmithC
Copy link
Collaborator Author

This issue is an instance of concerns outlined in Issue #13 .
Solutions include Automatically generating a nickname for a new camera and immediately adding it to the IndexDB, or adding a check for undefined nicknames to the sorting in the LiveViewSettingButtons component.

@SamsonSmithC
Copy link
Collaborator Author

Solved in commit: ed9cd24

Added conditional chaining to localeCompare call to prevent crashes and made camera nicknames default to the Serial Number to prevent any additional issues with undefined nicknames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant