mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 01:25:42 -05:00
Handle ua.Version not having a split function, log it
This commit is contained in:
parent
6d5f3e236f
commit
464c432ca6
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue