diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js
index 02975e2be..5817928ef 100644
--- a/src/node/handler/ImportHandler.js
+++ b/src/node/handler/ImportHandler.js
@@ -227,25 +227,27 @@ exports.doImport = function(req, res, padId)
//read the text
function(callback) {
- if(!directDatabaseAccess){
- fs.readFile(destFile, "utf8", function(err, _text){
- if(ERR(err, callback)) return;
- text = _text;
- // Title needs to be stripped out else it appends it to the pad..
- text = text.replace("
", "");
-
- //node on windows has a delay on releasing of the file lock.
- //We add a 100ms delay to work around this
- if(os.type().indexOf("Windows") > -1){
- setTimeout(function() {callback();}, 100);
- } else {
- callback();
- }
- });
- }else{
+ if (directDatabaseAccess) {
callback();
+
+ return;
}
+
+ fs.readFile(destFile, "utf8", function(err, _text){
+ if(ERR(err, callback)) return;
+ text = _text;
+ // Title needs to be stripped out else it appends it to the pad..
+ text = text.replace("", "");
+
+ //node on windows has a delay on releasing of the file lock.
+ //We add a 100ms delay to work around this
+ if(os.type().indexOf("Windows") > -1){
+ setTimeout(function() {callback();}, 100);
+ } else {
+ callback();
+ }
+ });
},
//change text of the pad and broadcast the changeset