Skip to content

Commit

Permalink
fixed unpack bug
Browse files Browse the repository at this point in the history
  • Loading branch information
VanCoding committed Mar 22, 2013
1 parent ee662b8 commit c4f781e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Expand Up @@ -92,18 +92,18 @@ function parseNBT(buffer,index){

function unpackNBT(data,cb){
cb = cb||noop;
zlib.inflate(data,function(err,data){
zlib.inflate(data,function(err,d){
if(err){
zlib.gunzip(data,function(err,data){
zlib.gunzip(data,function(err,d){
if(err){
cb(err);
}else{
cb(null,parseNBT(data));
cb(null,parseNBT(d));
}
});

}else{
cb(null,parseNBT(data));
cb(null,parseNBT(d));
}
});
}
Expand Down

0 comments on commit c4f781e

Please sign in to comment.