patw0929 / react-intl-tel-input

Rewrite International Telephone Input in React.js. (Looking for maintainers, and PRs & contributors are also welcomed!)
https://patw0929.github.io/react-intl-tel-input/
MIT License
283 stars 222 forks source link

fix: library crashes when localStorage is not callable #342

Closed YuLeven closed 4 years ago

YuLeven commented 4 years ago

Currently, we're checking for localStorage's presence but not its actual usability. In some scenarios, browsers can disallow localStorage to be called upon and in such cases, the library will hard crash.

In this change, I added a catch statement to intercept these errors and return an empty string when localStorage cannot be called upon.

mcataford commented 4 years ago

Hi @YuLeven ! Just following up on this, let me know your thoughts!

patw0929 commented 4 years ago

:tada: This PR is included in version 8.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: