From d3b939690ce2fe2c6d24830d4f6b4f4337a41844 Mon Sep 17 00:00:00 2001 From: Dmitry Molotkov Date: Thu, 3 Jan 2019 00:52:09 +0300 Subject: [PATCH] fix(server): process browser version with non semver versions (#4673) --- packages/server/src/middleware/modern.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/middleware/modern.js b/packages/server/src/middleware/modern.js index c1f779b80a..915ce1d837 100644 --- a/packages/server/src/middleware/modern.js +++ b/packages/server/src/middleware/modern.js @@ -17,6 +17,9 @@ const isModernBrowser = (ua) => { } const { browser } = UAParser(ua) const browserVersion = semver.coerce(browser.version) + if (!browserVersion) { + return false + } return modernBrowsers[browser.name] && semver.gte(browserVersion, modernBrowsers[browser.name]) }