diff options
author | Andrew Hoefling <andrew@hoeflingsoftware.com> | 2019-03-05 18:14:01 -0500 |
---|---|---|
committer | Santiago Fernandez Madero <safern@microsoft.com> | 2019-03-08 11:20:58 -0800 |
commit | 5f9e81d1577345c4f3fc4df475b8f3e7f672f0ce (patch) | |
tree | a6f2f99998959572970b0fc464f5f37c3be962c8 /src | |
parent | b474a2a96d6ca31f3a093fd83b49537eee382794 (diff) | |
download | coreclr-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')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs | 5 |
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) { |