mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
Fixed if using splice in loop should always decrement index or might out of array range
This commit is contained in:
parent
3683a6dd34
commit
332413bcaa
2 changed files with 12 additions and 4 deletions
|
@ -123,8 +123,10 @@ function addHistory(id, text, time, tags, notehistory) {
|
|||
|
||||
function removeHistory(id, notehistory) {
|
||||
for (var i = 0; i < notehistory.length; i++) {
|
||||
if (notehistory[i].id == id)
|
||||
if (notehistory[i].id == id) {
|
||||
notehistory.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
return notehistory;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue