ImportHandler: early return via DeMorgan's law

Inverted a boolean condition, no functional changes.
pull/3509/head
muxator 2018-10-31 23:15:01 +01:00
parent 9d104cc4b0
commit fb552b2dbb
1 changed files with 13 additions and 11 deletions

View File

@ -169,20 +169,22 @@ exports.doImport = function(req, res, padId)
var fileIsTXT = (fileEnding === ".txt");
if (fileIsTXT) useConvertor = false; // Don't use convertor for text files
// See https://github.com/ether/etherpad-lite/issues/2572
if (useConvertor && !fileIsHTML) {
convertor.convertFile(srcFile, destFile, exportExtension, function(err) {
//catch convert errors
if(err) {
console.warn("Converting Error:", err);
return callback("convertFailed");
} else {
callback();
}
});
} else {
if (fileIsHTML || (useConvertor === false)) {
// if no convertor only rename
fs.rename(srcFile, destFile, callback);
return;
}
convertor.convertFile(srcFile, destFile, exportExtension, function(err) {
//catch convert errors
if(err) {
console.warn("Converting Error:", err);
return callback("convertFailed");
} else {
callback();
}
});
},
function(callback) {