fix(server): process browser version with non semver versions (#4673)

This commit is contained in:
Dmitry Molotkov 2019-01-03 00:52:09 +03:00 committed by Pooya Parsa
parent 471a32a1a8
commit d3b939690c

View File

@ -17,6 +17,9 @@ const isModernBrowser = (ua) => {
} }
const { browser } = UAParser(ua) const { browser } = UAParser(ua)
const browserVersion = semver.coerce(browser.version) const browserVersion = semver.coerce(browser.version)
if (!browserVersion) {
return false
}
return modernBrowsers[browser.name] && semver.gte(browserVersion, modernBrowsers[browser.name]) return modernBrowsers[browser.name] && semver.gte(browserVersion, modernBrowsers[browser.name])
} }