Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle callback error in readAsTextAsync & check CRC #232

Merged
merged 3 commits into from
Oct 11, 2018

Conversation

kevincharm
Copy link
Contributor

Hi, I found some issues around readAsTextAsync:
readAsTextAsync passes a callback down to getDataAsync but only checks for a non-empty data object:

item.getDataAsync(function (data) {

Then getDataAsync passes down that callback to decompress:
getDataAsync : function(/*Function*/callback, pass) {

Then decompress can invoke that callback with non-empty (!) data and an error string:
if (async && callback) callback(data, Utils.Errors.BAD_CRC);//si added error

So this PR just handles that potential error that can propagate up. Then I also added some tests around zips with good/bad CRCs. Also found that CRC check wasn't failing on zips with deliberately bad corrupted CRCs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants