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

[RFR][v3] useSuggestions - don't crash on empty value #3971

Merged
merged 2 commits into from
Nov 13, 2019
Merged

[RFR][v3] useSuggestions - don't crash on empty value #3971

merged 2 commits into from
Nov 13, 2019

Conversation

natrim
Copy link
Contributor

@natrim natrim commented Nov 12, 2019

if default value is undefined it crashes on String.replace

useSuggestions.js:77 Uncaught TypeError: Cannot read property 'replace' of undefined
at escapeRegExp (useSuggestions.js:77)
at useSuggestions.js:91
at useSuggestions.js:151
at Array.filter ()
at useSuggestions.js:150

@natrim
Copy link
Contributor Author

natrim commented Nov 13, 2019

@fzaninotto i added the test

it will fail without fix in this PR
and added test for the '0' value to show it passes trough right

@fzaninotto fzaninotto merged commit a0e0893 into marmelab:next Nov 13, 2019
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 3.0.0 milestone Nov 13, 2019
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