From 86aac58b9e9f73d9eae82359ca2c3d85d40ffa8b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 21:28:14 +0000 Subject: [PATCH] Validate negative startIndex in ObservableList.RemoveRange Throw ArgumentOutOfRangeException before taking the lock, matching the existing count guard, so callers get a deterministic exception instead of an IndexOutOfRangeException from the per-item read at items[i] = _list[startIndex + i]. --- Runtime/Observable/ObservableList.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Runtime/Observable/ObservableList.cs b/Runtime/Observable/ObservableList.cs index c67034b..f411f22 100644 --- a/Runtime/Observable/ObservableList.cs +++ b/Runtime/Observable/ObservableList.cs @@ -168,6 +168,7 @@ public void RemoveAt(int index) public void RemoveRange(int startIndex, int count) { + if (startIndex < 0) throw new ArgumentOutOfRangeException(nameof(startIndex)); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count)); lock (SyncRoot)