Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TryGetField throws 'Index outside the bounds of the array' exception for DateTime converters #1250

Closed
paulcurren opened this issue Mar 6, 2019 · 1 comment
Labels

Comments

@paulcurren
Copy link

Issue is here:
line 707: if (string.IsNullOrWhiteSpace(context.Record[index]))

This extra bit of code does not range change the index in the same way that GetField(type, index, converter) does. Hence it is possible to get an exception if you don't have enough columns in your data and the converter type is DateTime.

E.g.:
Field1, Field2, Field3, Field4
1, 2, 3

TryGetField(typeof(DateTime), "Field4", out object value);

@JoshClose JoshClose added the bug label Mar 11, 2019
@JoshClose
Copy link
Owner

Fixed. This will be in release >= 12.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants