From af9ba8cda5d244bb49c2a9e607a6b2cd8d6ba759 Mon Sep 17 00:00:00 2001 From: Gabe Hopper Date: Fri, 23 Oct 2015 13:27:33 -0700 Subject: [PATCH] make chrome check safe if name is not specified. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 564184f..292eca1 100644 --- a/index.js +++ b/index.js @@ -152,7 +152,7 @@ } else if (req.query['agent'] === type) { agentTypes.push(req.query['agent']); newVal = '1'; - } else if (type === 'Chrome' &&agent.Browser.name == 'chrome' ) { + } else if (type === 'Chrome' && (agent.Browser && agent.Browser.name == 'chrome' )) { agentTypes.push(type); newVal = '1'; }