File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Server Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,11 @@ public virtual int SetValues(params object[] values)
268
268
// Allow values array longer than FieldCount, just ignore the extra cells.
269
269
int copyLength = ( values . Length > FieldCount ) ? FieldCount : values . Length ;
270
270
271
+ if ( copyLength == 0 )
272
+ {
273
+ return 0 ;
274
+ }
275
+
271
276
ExtendedClrTypeCode [ ] typeCodes = new ExtendedClrTypeCode [ copyLength ] ;
272
277
273
278
// Verify all data values as acceptable before changing current state.
@@ -285,8 +290,8 @@ public virtual int SetValues(params object[] values)
285
290
}
286
291
}
287
292
288
- // Now move the data (it'll only throw if someone plays with the values array between
289
- // the validation loop and here, or if an invalid UDT was sent) .
293
+ // Now move the data. We've already validated the element types above, so this will
294
+ // only throw if an invalid UDT was sent.
290
295
for ( int i = 0 ; i < copyLength ; i ++ )
291
296
{
292
297
ValueUtilsSmi . SetCompatibleValueV200 (
You can’t perform that action at this time.
0 commit comments