mirror of
https://github.com/lancedikson/bowser
synced 2026-03-02 03:40:27 +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:
@@ -90,6 +90,7 @@
|
||||
seamonkey: t
|
||||
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
var bowser = detect()
|
||||
|
||||
Reference in New Issue
Block a user