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

navigator.userAgent is expected to be a string #178

Open
nirazul opened this issue Apr 30, 2018 · 0 comments
Open

navigator.userAgent is expected to be a string #178

nirazul opened this issue Apr 30, 2018 · 0 comments

Comments

@nirazul
Copy link

nirazul commented Apr 30, 2018

I've run into some error reports that I could trace back to these lines of code.

The problem is, that navigator.userAgent is expected to be a string. Some browsers behave differently and allow the user to completely suppress sending a userAgent property at all.

An easy fix would be to set a default value like this:

const ua = navigator.userAgent || '';
ua.match(olderEdgeUA); // <-- this is safe now

I could prepare a PR, if you're ok with the changes.

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

No branches or pull requests

1 participant