From 3bfd164aa5b5d57f5997c2f5e149b5ba122f0645 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Tue, 28 May 2024 20:44:52 +0700 Subject: [PATCH] Fix #700 - Error on getOS() when userAgentData.platform is undefined --- src/ua-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ua-parser.js b/src/ua-parser.js index fc1d633d2..cf1012b66 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -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