Skip to content

Commit 3bfd164

Browse files
committed
Fix #700 - Error on getOS() when userAgentData.platform is undefined
1 parent e7bfc4e commit 3bfd164

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ua-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@
872872
_os[NAME] = undefined;
873873
_os[VERSION] = undefined;
874874
rgxMapper.call(_os, _ua, _rgxmap.os);
875-
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
875+
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != 'Unknown') {
876876
_os[NAME] = _uach.platform
877877
.replace(/chrome os/i, CHROMIUM_OS)
878878
.replace(/macos/i, MAC_OS); // backward compatibility

0 commit comments

Comments
 (0)