Skip to content

Commit

Permalink
Hotfix for error in server while loading pathways
Browse files Browse the repository at this point in the history
  • Loading branch information
istemi-bahceci committed Mar 17, 2017
1 parent 511408e commit 4f8deb7
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ function indexGetHandler(req,res){
********************************/
function loadGraphHandler(req, res)
{
fs.readFile(req.file.path, {encoding: 'utf-8'}, function(err,data)
if(req.file)
{
if (!err)
fs.readFile(req.file.path, {encoding: 'utf-8'}, function(err,data)
{
res.writeHead(200, {'Content-Type': 'multipart/form-data'});
res.write(data);
res.end();
}
else
{
console.log(err);
}
fs.unlinkSync(req.file.path);
});
if (!err)
{
res.writeHead(200, {'Content-Type': 'multipart/form-data'});
res.write(data);
res.end();
}
else
{
console.log(err);
}
fs.unlinkSync(req.file.path);
});
}
}

function loadSampleFile(req, res)
Expand Down

0 comments on commit 4f8deb7

Please sign in to comment.