When creating test files I inadvertently left data on one of the data lines - which inserted an additional comma on the header line. When testing I received the unhelpful message "Value cannot be null.\r\nParameter name: key".
After digging around I found the culprit in FieldMapper.cs on line 413,
if (!m_NameToInfo.ContainsKey(row[i].Value))
Specifically, the extra comma in the header meant that row[i]Value evaluated as null.
While my case was certainly a fringe case the issue is easily solved be adding an additional exception type and checking for null prior to evaluating the column header.
Would be happy to submit a pull request if you'd like.
When creating test files I inadvertently left data on one of the data lines - which inserted an additional comma on the header line. When testing I received the unhelpful message "Value cannot be null.\r\nParameter name: key".
After digging around I found the culprit in FieldMapper.cs on line 413,
if (!m_NameToInfo.ContainsKey(row[i].Value))
Specifically, the extra comma in the header meant that
row[i]Value
evaluated asnull
.While my case was certainly a fringe case the issue is easily solved be adding an additional exception type and checking for null prior to evaluating the column header.
Would be happy to submit a pull request if you'd like.