bestiejs / platform.js

A platform detection library.
https://mths.be/platform
MIT License
3.22k stars 408 forks source link

Cannot read property '0' of null #109 -- not fixed #196

Open JulianneZech opened 2 years ago

JulianneZech commented 2 years ago

I am using version 1.3.3 and still encountering the same problem raised in this issue.

Screen Shot 2021-11-29 at 3 56 24 PM

As the screenshot below demonstrates, data.version is undefined in this case.

Screen Shot 2021-11-29 at 3 50 20 PM

The following change is working for me.

if (data.version)
  version = /[\d.]+/.exec(data.version)[0];
else 
  version = /[\d.]+/.exec(data.env.VERSION)[0];

I'm not sure exactly why this is occurring, but the issue seems to arise when I install stompjs@2.3.3 or webstomp-client@1.2.6 in my project, not meteor as originally reported.

My setup info below - happy to provide more details or a complete reproduction if helpful. Angular CLI: 8.3.26 Node: 16.13.0 OS: darwin x64 Angular: 8.2.14