[corlib] Fixes security tests failures
[mono.git] / mcs / class / System.Data / System.Data.OleDb / OleDbErrorCollection.cs
index 194e2627615bc33b6e21f9e820dc553faca07b02..1099eb6c6f18d31b1dee8cb62e79884c2907ad1d 100644 (file)
@@ -93,19 +93,22 @@ namespace System.Data.OleDb
                
                public void CopyTo (Array array, int index) 
                {
-                       if (array == null)
-                                throw new ArgumentNullException("array");
-                                                                                                    
-                        if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound (0)))
-                                throw new ArgumentOutOfRangeException("index");
-                                                                                                    
-                        // is the check for IsFixedSize required?
-                        if ((array.IsFixedSize) || (index + this.Count > array.GetUpperBound (0)))
-                                throw new ArgumentException("array");
+                       if (array == null)
+                               throw new ArgumentNullException("array");
 
-                       ((OleDbError[]) (items.ToArray ())).CopyTo (array, index);
+                       if ((index < array.GetLowerBound (0)) || (index > array.GetUpperBound (0)))
+                               throw new ArgumentOutOfRangeException("index");
 
+                       // is the check for IsFixedSize required?
+                       if ((array.IsFixedSize) || (index + this.Count > array.GetUpperBound (0)))
+                               throw new ArgumentException("array");
 
+                       ((OleDbError[]) (items.ToArray ())).CopyTo (array, index);
+               }
+
+               public void CopyTo (OleDbError [] array, int index)
+               {
+                       items.CopyTo (array, index);
                }
 
                public IEnumerator GetEnumerator ()