Commit 3d3a5d58 authored by konovalovsergey's avatar konovalovsergey

error in spreadsheet in case of null Editor.xlsx url

parent 226b04a2
...@@ -975,19 +975,18 @@ var editor; ...@@ -975,19 +975,18 @@ var editor;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
var openXml = AscCommon.openXml; var openXml = AscCommon.openXml;
//open cache xlsx instead of documentUrl, to support pivot in xls, ods... and don't send jwt signature //open cache xlsx instead of documentUrl, to support pivot in xls, ods... and don't send jwt signature
if (t.isChartEditor && url) { if (t.isChartEditor) {
resolve(); resolve();
return; return;
} }
var processData = function (err, data) { var processData = function (err, data) {
if (err) { var nextPromise;
reject(err); // or handle err if (!err && data) {
} else {
openXml.SaxParserDataTransfer.wb = wb; openXml.SaxParserDataTransfer.wb = wb;
var doc = new openXml.OpenXmlPackage(); var doc = new openXml.OpenXmlPackage();
var wbPart = null; var wbPart = null;
var wbXml = null; var wbXml = null;
var loadAsyncFile = require('jszip').loadAsync(data).then(function (zip) { nextPromise = require('jszip').loadAsync(data).then(function (zip) {
return doc.openFromZip(zip); return doc.openFromZip(zip);
}).then(function () { }).then(function () {
wbPart = doc.getPartByRelationshipType(openXml.relationshipTypes.workbook); wbPart = doc.getPartByRelationshipType(openXml.relationshipTypes.workbook);
...@@ -1064,12 +1063,20 @@ var editor; ...@@ -1064,12 +1063,20 @@ var editor;
if (window.console && window.console.log) { if (window.console && window.console.log) {
window.console.log(err); window.console.log(err);
} }
}).then(function (err) { });
//clean up } else {
openXml.SaxParserDataTransfer = {}; if (err) {
return Asc.ReadDefTableStyles(wb); if (window.console && window.console.log) {
}).then(resolve, reject); window.console.log(err);
}
}
nextPromise = Promise.resolve();
} }
nextPromise.then(function (err) {
//clean up
openXml.SaxParserDataTransfer = {};
return Asc.ReadDefTableStyles(wb);
}).then(resolve, reject);
}; };
if (typeof url === "string") { if (typeof url === "string") {
require('jsziputils').getBinaryContent(url, processData); require('jsziputils').getBinaryContent(url, processData);
......
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