mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Wrap RangeTracker in try catch
This commit is contained in:
parent
a3a9a726d8
commit
b9e4492001
1 changed files with 4 additions and 1 deletions
|
@ -13,7 +13,10 @@ module.exports = RangesManager =
|
||||||
if !!update.meta.tc
|
if !!update.meta.tc
|
||||||
rangesTracker.setIdSeed(update.meta.tc)
|
rangesTracker.setIdSeed(update.meta.tc)
|
||||||
for op in update.op
|
for op in update.op
|
||||||
rangesTracker.applyOp(op, { user_id: update.meta?.user_id })
|
try
|
||||||
|
rangesTracker.applyOp(op, { user_id: update.meta?.user_id })
|
||||||
|
catch error
|
||||||
|
return callback(error)
|
||||||
|
|
||||||
if rangesTracker.changes?.length > RangesManager.MAX_CHANGES or rangesTracker.comments?.length > RangesManager.MAX_COMMENTS
|
if rangesTracker.changes?.length > RangesManager.MAX_CHANGES or rangesTracker.comments?.length > RangesManager.MAX_COMMENTS
|
||||||
return callback new Error("too many comments or tracked changes")
|
return callback new Error("too many comments or tracked changes")
|
||||||
|
|
Loading…
Reference in a new issue