From 464c432ca63237454ab5da8303543eb44299749f Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 16 May 2016 10:42:13 -0700 Subject: [PATCH] Handle ua.Version not having a split function, log it --- server_setup.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server_setup.coffee b/server_setup.coffee index ec9a2be07..c1adc9b79 100644 --- a/server_setup.coffee +++ b/server_setup.coffee @@ -147,7 +147,11 @@ setupMiddlewareToSendOldBrowserWarningWhenPlayersViewLevelDirectly = (app) -> return true if ua.isiPad or ua.isiPod or ua.isiPhone or ua.isOpera return false unless ua and ua.Browser in ['Chrome', 'Safari', 'Firefox', 'IE'] and ua.Version b = ua.Browser - v = parseInt ua.Version.split('.')[0], 10 + try + v = parseInt ua.Version.split('.')[0], 10 + catch TypeError + log.error('ua.Version does not have a split function.', JSON.stringify(ua, null, ' ')) + return false return true if b is 'Chrome' and v < 17 return true if b is 'Safari' and v < 6 return true if b is 'Firefox' and v < 21