summaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-12-01 17:50:29 +0000
committerJohn McLear <john@mclear.co.uk>2015-12-01 17:50:29 +0000
commitf44c444720013fbb4a5e262367172f4fde00ba75 (patch)
tree60d777ad99cdcd5733d0a92084d9c2b66f26c62a /src/node
parent16bb28a0ffe155e40bc778a2ff21b1bc444fd77f (diff)
parent2bd698343a586f627e8b577da2e190d37592e77a (diff)
downloadetherpad-lite-f44c444720013fbb4a5e262367172f4fde00ba75.zip
Merge pull request #2831 from fcassin/develop
Protect against a null atext value in cloneAText
Diffstat (limited to 'src/node')
-rw-r--r--src/node/db/Pad.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js
index 83e15e6d..5d26f470 100644
--- a/src/node/db/Pad.js
+++ b/src/node/db/Pad.js
@@ -188,7 +188,12 @@ Pad.prototype.getInternalRevisionAText = function getInternalRevisionAText(targe
db.getSub("pad:"+_this.id+":revs:"+keyRev, ["meta", "atext"], function(err, _atext)
{
if(ERR(err, callback)) return;
- atext = Changeset.cloneAText(_atext);
+ try {
+ atext = Changeset.cloneAText(_atext);
+ } catch (e) {
+ return callback(e);
+ }
+
callback();
});
},