From c7778c550e9e75381f72e5a8872c47e77052f421 Mon Sep 17 00:00:00 2001 From: devel-pa Date: Wed, 24 Aug 2016 18:30:09 +0200 Subject: [PATCH] Act safe in case navigator doesn't have a userAgent. --- src/bowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 676a64a..a6059c2 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -395,7 +395,7 @@ return result } - var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '') + var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '') bowser.test = function (browserList) { for (var i = 0; i < browserList.length; ++i) {