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
pull/20/head
Martino di Filippo 11 years ago
parent 23545d4403
commit 601eac6897

@ -90,6 +90,7 @@
seamonkey: t
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
}
return {}
}
var bowser = detect()

Loading…
Cancel
Save