From f0fdb94eb084852975ede3eadeeef691505eab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Schr=C3=B6der?= Date: Wed, 15 Apr 2020 00:49:11 +0200 Subject: [PATCH] PadMessageHandler: fix for scoping error hiding original error `r` is undefined outside of the for loop, but used in the catch block of the try statement --- src/node/handler/PadMessageHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 5be683e2d..acd9a29c6 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -1429,11 +1429,12 @@ async function composePadChangesets (padId, startNum, endNum) })); // compose Changesets + let r; try { let changeset = changesets[startNum]; let pool = pad.apool(); - for (let r = startNum + 1; r < endNum; r++) { + for (r = startNum + 1; r < endNum; r++) { let cs = changesets[r]; changeset = Changeset.compose(changeset, cs, pool); }