From a23ae902b8332278a8f21c0aced79648376c943c Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Mon, 5 May 2014 17:55:33 -0600 Subject: [PATCH] Update ua-parser.js Prevents errors (cannot call .toLowerCase() on function) when Objects are extended downstream. --- src/ua-parser.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ua-parser.js b/src/ua-parser.js index 6ae21aa..a8e5397 100644 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -38,7 +38,9 @@ var util = { has : function (str1, str2) { + if (typeof str1 === "string") { return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; + } }, lowerize : function (str) { return str.toLowerCase();