From ec453f2e8803766bb9e3dc83d60ff67392cf7e8a Mon Sep 17 00:00:00 2001 From: Damon Poole Date: Wed, 26 Feb 2014 00:54:20 +1000 Subject: [PATCH] Wrapped getUnit8() Wrapping this `if` clause in a `try...catch` seems to alleviate the issue found in https://github.com/43081j/id3/issues/10 and possibly https://github.com/43081j/id3/issues/9 There seems to be no real negative impact in simply ignoring any exceptions generated by the tried code, the resulting `tags` seems to be completely fine. --- dist/id3.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/id3.js b/dist/id3.js index 0724ebf..6833f95 100644 --- a/dist/id3.js +++ b/dist/id3.js @@ -693,9 +693,13 @@ } i++; } else { - if(dv.getUint8(i) === 0x00) { - variableStart = i + 1; - break; + try { + if(dv.getUint8(i) === 0x00) { + variableStart = i + 1; + break; + } + } catch(e) { + break; } } }