Null Check on JsonWriter.WriteToken

Fixes #752
This commit is contained in:
Jon Hanna
2015-12-20 14:23:01 +00:00
parent dca5260334
commit d764cfae1a
2 changed files with 11 additions and 1 deletions
@@ -897,6 +897,16 @@ Parameter name: value");
}
}
[Test]
public void WriteTokenNullCheck()
{
using (JsonWriter jsonWriter = new JsonTextWriter(new StringWriter()))
{
ExceptionAssert.Throws<ArgumentNullException>(() => { jsonWriter.WriteToken(null); });
ExceptionAssert.Throws<ArgumentNullException>(() => { jsonWriter.WriteToken(null, true); });
}
}
[Test]
public void BadWriteEndArray()
{
+1 -1
View File
@@ -483,7 +483,7 @@ namespace Newtonsoft.Json
/// <param name="reader">The <see cref="JsonReader"/> to read the token from.</param>
public void WriteToken(JsonReader reader)
{
WriteToken(reader, true, true, true);
WriteToken(reader, true);
}
/// <summary>