summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-10-22 16:15:27 +0100
committerJohn McLear <john@mclear.co.uk>2015-10-22 16:15:27 +0100
commitfa46f0b613c85c758d74e1cd8adb4760e33071b4 (patch)
tree9f3b2ef51717cef95c442da2f6816e186a1bac50
parent3aff0001a1eaf4fa403213526cfccdbc9a73b097 (diff)
parentc9924ee706edca1591b1c879f8e5d593b48f254c (diff)
downloadetherpad-lite-fa46f0b613c85c758d74e1cd8adb4760e33071b4.zip
Merge pull request #2797 from ypid/rebuild-better-error
Give better error message when rebuildPad.js hits a non-existing rev.
-rw-r--r--bin/rebuildPad.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/rebuildPad.js b/bin/rebuildPad.js
index c8383342..60c5f4ed 100644
--- a/bin/rebuildPad.js
+++ b/bin/rebuildPad.js
@@ -79,6 +79,9 @@ async.series([
newPad.pool.numToAttrib = oldPad.pool.numToAttrib;
for(var curRevNum = 0; curRevNum <= newRevHead; curRevNum++) {
db.db.get("pad:" + padId + ":revs:" + curRevNum, function(err, rev) {
+ if (rev.meta) {
+ throw "The specified revision number could not be found.";
+ }
var newRevNum = ++newPad.head;
var newRevId = "pad:" + newPad.id + ":revs:" + newRevNum;
db.db.set(newRevId, rev);