kevlened / isomorphic-webcrypto

:game_die: webcrypto library for Node, React Native and IE11+
https://www.w3.org/TR/WebCryptoAPI/
MIT License
116 stars 43 forks source link

React Native TypeError: Cannot convert null value to object #44

Open TheFrostage opened 3 years ago

TheFrostage commented 3 years ago

Hello. I am getting this error when launching a React Native application. Here is the screenshot:

Screen Shot 2021-04-13 at 13 50 47

The error here is because of userAgent being equal to "chrome", therefore the exec function on a regex returns null. I'm running React Native v.0.64.0, React 17.0.1 on macOS Catalina 10.15.6. I also enabled Hermes on iOS. What is the correct way to handle this issue? I should say that dismissing this error in development allows to continue using the application, but I'm afraid I this issue can have hidden consequences.