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

Handle whitespace-only strings during seed phrase import #6743

Merged
merged 3 commits into from
Jun 27, 2019

Conversation

whymarrh
Copy link
Contributor

Fixes #6694

This PR fixes our parsing of seed phrases during import to handle the case where a user tries to import a seed phrase that consists solely of whitespace. We no longer produce an error and instead treat it as an incorrect seed phrase.

@whymarrh whymarrh requested a review from danjm as a code owner June 23, 2019 12:32
return ''
}

return trimmed.match(/\w+/g).join(' ')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like certain inputs would still result in this failing (e.g. $). Maybe the result of match should be checked too? To ensure it isn't null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch! I'll fix this up too!

Fixes MetaMask#6694

This changeset fixes our parsing of seed phrases during import to handle the
case where a user tries to import a seed phrase that consists solely of whitespace.
We no longer produce an error and instead treat it as an incorrect seed phrase.
@whymarrh whymarrh merged commit d566543 into MetaMask:develop Jun 27, 2019
@whymarrh whymarrh deleted the fix-6694 branch June 27, 2019 17:14
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.

TypeError: Cannot read property 'join' of null
3 participants