3rd-Eden / useragent

Useragent parser for Node.js, ported from browserscope.org
MIT License
897 stars 137 forks source link

iOS8 parse() crashes #55

Closed jorisroling closed 9 years ago

jorisroling commented 9 years ago

Hi Arnout,

The Useragent string

"Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A365 Safari/600.1.4"

crashes the parse() function.

I get: [TypeError: Invalid Version: 8.0.undefined]

Cheers, Joris

3rd-Eden commented 9 years ago

I'm unable to reproduce this, could you check if 2.0.10 resolves these issues for you? I released it a couple of minutes ago.

jorisroling commented 9 years ago

Hi Arnout,

My bad, I assumed that the structure agent.os.toJSON() returned would always contain a valid patch field, and with iOS8 devices it did not (undefined). I solved it by checking the validity first.

Thanks for you time! (and sorry for wasting it)

J*

3rd-Eden commented 9 years ago

@jorisroling Oh, I would actually see that an issue. This library should just provide sane defaults. So 2.1 will default everything 0 as expected.

jorisroling commented 9 years ago

Cheers!

— Sent from Mailbox

On Mon, Sep 22, 2014 at 12:55 PM, Arnout Kazemier notifications@github.com wrote:

@jorisroling Oh, I would actually see that an issue. This library should just provide sane defaults. So 2.1 will default everything 0 as expected.

Reply to this email directly or view it on GitHub: https://github.com/3rd-Eden/useragent/issues/55#issuecomment-56357365