jhermsmeier / node-udif

Apple Universal Disk Image Format (UDIF/DMG)
MIT License
12 stars 3 forks source link

Error handling issues in lib/image.js #12

Closed zvin closed 6 years ago

zvin commented 6 years ago

Here: https://github.com/jhermsmeier/node-udif/blob/master/lib/image.js#L188 and here: https://github.com/jhermsmeier/node-udif/blob/master/lib/image.js#L222

size doesn't exist, length should be used.

Also Image is not an event emitter so this.emit('error', error) won't work. It should call the callback with the error instead.

jhermsmeier commented 6 years ago

Good catch, thanks! Fixed in f66b2f75d43c8eb0f335c544a0a98d24dcb5fbfe, and published as udif@0.15.7