summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRobin Schneider <ypid@riseup.net>2015-10-07 12:42:19 +0200
committerRobin Schneider <ypid@riseup.net>2015-10-07 12:42:19 +0200
commitc9924ee706edca1591b1c879f8e5d593b48f254c (patch)
tree95e670aaff049eec378e5f39daa6c018dae993b3 /bin
parenta09044a6f3fa610d23b45dbcef675ee4b6b6395b (diff)
downloadetherpad-lite-c9924ee706edca1591b1c879f8e5d593b48f254c.zip
Give better error message when rebuildPad.js hits a non-existing rev.
Diffstat (limited to 'bin')
-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);