Skip to content

Commit d441bd3

Browse files
authored
Merge pull request #3888 from Tyriar/3885
Prevent exception when deleting non-existent element
2 parents 915fa49 + 098b225 commit d441bd3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common/SortedList.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export class SortedList<T> {
3535
}
3636
const key = this._getKey(value);
3737
let i = this._search(key, 0, this._array.length - 1);
38+
if (i === -1) {
39+
return false;
40+
}
3841
if (this._getKey(this._array[i]) !== key) {
3942
return false;
4043
}

0 commit comments

Comments
 (0)