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

Cannot convert undefined or null to object #16

Closed
RodriSanchez1 opened this issue May 30, 2023 · 1 comment · May be fixed by #17
Closed

Cannot convert undefined or null to object #16

RodriSanchez1 opened this issue May 30, 2023 · 1 comment · May be fixed by #17
Assignees
Labels
bug Something isn't working

Comments

@RodriSanchez1
Copy link

Hi! Thanks @thyngster for your work. Im working on a React app that is wrapped with Cordova to build an Electron app. The project its Cboard and the Cordova Cboard if you want to check it out .
We want to set up analytics on the Electron app. I tested your library. On web is working perfecltly but on the Electron app im facing this issue:

image

I think the problem is in this line. The User Agent Data on Electron is:
NavigatorUAData : { "brands": [], "mobile": false, "platform": "" }

And
image

On the retrived object, doesnt have fullVersionList prop
One solution can be add a comprobation before (Object.values(d.fullVersionList) || ....) something like (d.fullVersionList && Object.values(d.fullVersionList) || ....)

@thyngster thyngster self-assigned this May 30, 2023
@thyngster thyngster added the bug Something isn't working label May 30, 2023
@thyngster
Copy link
Member

yep, some browsers may not have full support for the client hints and the checks are not properly done on the code. I'm reviewing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants