diff options
author | jbevain <jbevain@gmail.com> | 2010-09-22 02:28:46 +0400 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2010-09-22 02:28:46 +0400 |
commit | 921537f15254481600da59dfe5aee09ee04315d6 (patch) | |
tree | 597914056c34e57f2f6f4d77267a40f9bca718cd /Mono.Collections.Generic | |
parent | 6314230d91da95085bbd31dbd2b7c664dc546eb2 (diff) |
Validate ReadOnlyCollection constructor inputs
Diffstat (limited to 'Mono.Collections.Generic')
-rw-r--r-- | Mono.Collections.Generic/ReadOnlyCollection.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Mono.Collections.Generic/ReadOnlyCollection.cs b/Mono.Collections.Generic/ReadOnlyCollection.cs index be686a4..35c9cd8 100644 --- a/Mono.Collections.Generic/ReadOnlyCollection.cs +++ b/Mono.Collections.Generic/ReadOnlyCollection.cs @@ -49,12 +49,18 @@ namespace Mono.Collections.Generic { public ReadOnlyCollection (T [] array) { + if (array == null) + throw new ArgumentNullException (); + this.items = array; this.size = array.Length; } public ReadOnlyCollection (Collection<T> collection) { + if (collection == null) + throw new ArgumentNullException (); + this.items = collection.items; this.size = collection.size; } |