Created
May 22, 2018 13:21
-
-
Save casperOne/ef98a0f9a224b6663d0408a595dfb5e5 to your computer and use it in GitHub Desktop.
CsvHelper 7.1.0 - CsvWriter NullReferenceException on multiple Dispose calls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using CsvHelper; | |
using Xunit; | |
namespace CsvHelperDisposeTests | |
{ | |
public class Tests | |
{ | |
[Fact] | |
public void Test_Dispose() | |
{ | |
// Create a stream. | |
using (var ms = new MemoryStream()) | |
using (var streamWriter = new StreamWriter(ms)) | |
{ | |
// Create the writer. | |
var writer = new CsvWriter(streamWriter); | |
// Dispose twice. | |
writer.Dispose(); | |
writer.Dispose(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment