mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-16 15:11:50 +03:00
Fix #700 - Error on getOS() when userAgentData.platform is undefined
This commit is contained in:
@@ -872,7 +872,7 @@
|
||||
_os[NAME] = undefined;
|
||||
_os[VERSION] = undefined;
|
||||
rgxMapper.call(_os, _ua, _rgxmap.os);
|
||||
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
||||
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != 'Unknown') {
|
||||
_os[NAME] = _uach.platform
|
||||
.replace(/chrome os/i, CHROMIUM_OS)
|
||||
.replace(/macos/i, MAC_OS); // backward compatibility
|
||||
|
||||
Reference in New Issue
Block a user