Skip to content

Commit 096c64a

Browse files
committed
Throw ArgumentNullExceptions for non-nullable params to the CsvDefinition.Write()
1 parent 4a56f93 commit 096c64a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CSharpVitamins.Tabulation/CSharpVitamins.Tabulation.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
`CharpVitamins.Tabulation` provides helpers to create tabular data with little fuss i.e. Tab or comma separated values (`CsvDefinition`),
1313
or padded columns of plain text (via `PlainTextTable`).</description>
1414
<releaseNotes>
15+
* 1.0.3: Now throws `ArgumentNullException` for non-nullable params to the `CsvDefinition.Write()` method
1516
* 1.0.2: Meta data update
1617
* 1.0.1: Adds `PlainTextTable.Divide()` method as a quick way to append a new divider.
1718
* 1.0.0: Initial release

CSharpVitamins.Tabulation/CsvDefinition.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ public bool Remove(string key, StringComparison comparison = StringComparison.Or
8181
/// <param name="delimiter">The string to delimit column values with. A single character delimiter isare also used to escape the value, multi-character strings are not escaped.</param>
8282
public void Write(TextWriter writer, IEnumerable<T> rows, string delimiter = ",")
8383
{
84+
if (writer == null)
85+
throw new ArgumentNullException(nameof(writer));
86+
87+
if (rows == null)
88+
throw new ArgumentNullException(nameof(rows));
89+
8490
if (delimiter == null)
8591
throw new ArgumentNullException(nameof(delimiter));
8692

CSharpVitamins.Tabulation/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
[assembly: ComVisible(false)]
1515
[assembly: Guid("09a98341-8845-4307-b4e4-5235b3cf9191")]
1616

17-
[assembly: AssemblyVersion("1.0.2")]
18-
[assembly: AssemblyFileVersion("1.0.2")]
17+
[assembly: AssemblyVersion("1.0.3")]
18+
[assembly: AssemblyFileVersion("1.0.3")]

0 commit comments

Comments
 (0)