mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Avoid exception when unable to match UA
Make detect() return an empty object if it hasn't matched any known browser, so that graded browser support (and any external code using this library) doesn't raise a "Cannot read property ... of undefined" exception
This commit is contained in:
parent
23545d4403
commit
601eac6897
@ -90,6 +90,7 @@
|
|||||||
seamonkey: t
|
seamonkey: t
|
||||||
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
|
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
|
||||||
}
|
}
|
||||||
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
var bowser = detect()
|
var bowser = detect()
|
||||||
|
Loading…
Reference in New Issue
Block a user