ImportHandler: early return by condition inversion

No functional changes
This commit is contained in:
muxator 2018-10-31 23:00:45 +01:00
parent 6727a77073
commit 395db73eb1

View file

@ -132,9 +132,14 @@ exports.doImport = function(req, res, padId)
}, },
function(callback) { function(callback) {
var fileEnding = path.extname(srcFile).toLowerCase() var fileEnding = path.extname(srcFile).toLowerCase()
var fileIsEtherpad = (fileEnding === ".etherpad"); var fileIsNotEtherpad = (fileEnding !== ".etherpad");
if (fileIsNotEtherpad) {
callback();
return;
}
if(fileIsEtherpad){
// we do this here so we can see if the pad has quit ea few edits // we do this here so we can see if the pad has quit ea few edits
padManager.getPad(padId, function(err, _pad){ padManager.getPad(padId, function(err, _pad){
var headCount = _pad.head; var headCount = _pad.head;
@ -150,9 +155,6 @@ exports.doImport = function(req, res, padId)
}); });
}); });
}); });
}else{
callback();
}
}, },
//convert file to html //convert file to html
function(callback) { function(callback) {