Commit c5bd6a8c authored by Ronny's avatar Ronny

修改zipjs L719 catch

parent 61db630e
......@@ -716,11 +716,17 @@
function seekEOCDR(offset, entriesCallback) {
reader.readUint8Array(reader.size - offset, offset, function(bytes) {
var dataView = getDataHelper(bytes.length, bytes).view;
if (dataView.getUint32(0) != 0x504b0506) {
seekEOCDR(offset + 1, entriesCallback);
} else {
entriesCallback(dataView);
try{
if (dataView.getUint32(0) != 0x504b0506) {
seekEOCDR(offset + 1, entriesCallback);
} else {
entriesCallback(dataView);
}
}catch(e){
console.log(e);
onerror(ERR_READ);
}
}, function() {
onerror(ERR_READ);
});
......
......@@ -74,6 +74,10 @@ KityMinder.registerProtocal( 'mindmanager', function () {
return result;
}
function onerror(){
alert('xmind文件过程解压出错,请检查该文件是否损坏');
}
function getEntries( file, onend ) {
zip.createReader( new zip.BlobReader( file ), function ( zipReader ) {
zipReader.getEntries( onend );
......
......@@ -80,6 +80,10 @@ KityMinder.registerProtocal( 'xmind', function () {
return result;
}
function onerror(){
alert('xmind文件过程解压出错,请检查该文件是否损坏');
}
function getEntries(file, onend) {
zip.createReader(new zip.BlobReader(file), function(zipReader) {
zipReader.getEntries(onend);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment