mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-27 19:06:15 -04:00
Handle errors from txt and html export correctly
This addresses crashes with Error: Not a exports: null at Object.exports.unpack at Object.exports.applyToText at Object.exports.applyToAText and Error: atext is null at Object.exports.cloneAText
This commit is contained in:
parent
6df7ff2d08
commit
89d1c717b0
1 changed files with 13 additions and 3 deletions
|
@ -78,8 +78,13 @@ exports.doExport = function(req, res, padId, type)
|
|||
{
|
||||
exporttxt.getPadTXTDocument(padId, req.params.rev, false, function(err, txt)
|
||||
{
|
||||
if(ERR(err)) return;
|
||||
res.send(txt);
|
||||
if (err) {
|
||||
res.status(400);
|
||||
res.send();
|
||||
console.log("Could not process export request:",err.message);
|
||||
} else {
|
||||
res.send(txt);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -94,7 +99,12 @@ exports.doExport = function(req, res, padId, type)
|
|||
{
|
||||
exporthtml.getPadHTMLDocument(padId, req.params.rev, false, function(err, _html)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
if (err) {
|
||||
res.status(400);
|
||||
res.send();
|
||||
console.log("Could not process export request:",err.message);
|
||||
return;
|
||||
}
|
||||
html = _html;
|
||||
callback();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue