mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 19:29: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)
|
exporttxt.getPadTXTDocument(padId, req.params.rev, false, function(err, txt)
|
||||||
{
|
{
|
||||||
if(ERR(err)) return;
|
if (err) {
|
||||||
|
res.status(400);
|
||||||
|
res.send();
|
||||||
|
console.log("Could not process export request:",err.message);
|
||||||
|
} else {
|
||||||
res.send(txt);
|
res.send(txt);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -94,7 +99,12 @@ exports.doExport = function(req, res, padId, type)
|
||||||
{
|
{
|
||||||
exporthtml.getPadHTMLDocument(padId, req.params.rev, false, function(err, _html)
|
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;
|
html = _html;
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue