summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib
diff options
context:
space:
mode:
authorAndrew Hoefling <andrew@hoeflingsoftware.com>2019-03-06 12:57:09 -0500
committerSantiago Fernandez Madero <safern@microsoft.com>2019-03-08 11:20:58 -0800
commit44e05888b328699d3a0ca4b76544d7c357b49b47 (patch)
tree25025d149c9a2d9d73bdcc8eff3b2c4627cfddc4 /src/System.Private.CoreLib
parent39be7e55798e4f81c531661b0df798e91c7d5936 (diff)
downloadcoreclr-44e05888b328699d3a0ca4b76544d7c357b49b47.tar.gz
coreclr-44e05888b328699d3a0ca4b76544d7c357b49b47.tar.bz2
coreclr-44e05888b328699d3a0ca4b76544d7c357b49b47.zip
InsertItemsRange API now checks if the underlying items.IsReadOnly first then collection == null
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r--src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs8
1 files changed, 4 insertions, 4 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 8aa387b0cd..f6d7f9878b 100644
--- a/src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
+++ b/src/System.Private.CoreLib/shared/System/Collections/ObjectModel/Collection.cs
@@ -172,14 +172,14 @@ namespace System.Collections.ObjectModel
protected virtual void InsertItemsRange(int index, IEnumerable<T> collection)
{
- if (collection == null)
+ if (items.IsReadOnly)
{
- ThrowHelper.ThrowArgumentNullException(ExceptionArgument.list);
+ ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_ReadOnlyCollection);
}
- if (items.IsReadOnly)
+ if (collection == null)
{
- ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_ReadOnlyCollection);
+ ThrowHelper.ThrowArgumentNullException(ExceptionArgument.list);
}
if ((uint)index > (uint)items.Count)