summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib
diff options
context:
space:
mode:
authorAndrew Hoefling <andrew@hoeflingsoftware.com>2019-03-05 18:14:01 -0500
committerSantiago Fernandez Madero <safern@microsoft.com>2019-03-08 11:20:58 -0800
commit5f9e81d1577345c4f3fc4df475b8f3e7f672f0ce (patch)
treea6f2f99998959572970b0fc464f5f37c3be962c8 /src/System.Private.CoreLib
parentb474a2a96d6ca31f3a093fd83b49537eee382794 (diff)
downloadcoreclr-5f9e81d1577345c4f3fc4df475b8f3e7f672f0ce.tar.gz
coreclr-5f9e81d1577345c4f3fc4df475b8f3e7f672f0ce.tar.bz2
coreclr-5f9e81d1577345c4f3fc4df475b8f3e7f672f0ce.zip
Added ArgumentOutOfRangeException exception in RemoveRange if the count is less than 0
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r--src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs b/src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
index 3fb2693da3..4099682811 100644
--- a/src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
+++ b/src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
@@ -207,6 +207,11 @@ namespace System.Collections.ObjectModel
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index, ExceptionResource.ArgumentOutOfRange_ListInsert);
}
+ if (count < 0)
+ {
+ ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.count, ExceptionResource.ArgumentOutOfRange_ListInsert);
+ }
+
int length = items.Count;
if (index < items.Count - count)
{