-Fixed error handling serializing invalid JSON in certain cases
This commit is contained in:
@@ -582,7 +582,6 @@ namespace Newtonsoft.Json
|
||||
private void AutoCompleteClose(JsonToken tokenBeingClosed)
|
||||
{
|
||||
// write closing symbol and calculate new state
|
||||
|
||||
int levelsToComplete = 0;
|
||||
JsonContainerType type = GetTypeForCloseToken(tokenBeingClosed);
|
||||
|
||||
@@ -612,6 +611,9 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
JsonToken token = GetCloseTokenForType(Pop());
|
||||
|
||||
if (_currentState == State.Property)
|
||||
WriteNull();
|
||||
|
||||
if (_formatting == Formatting.Indented)
|
||||
{
|
||||
if (_currentState != State.ObjectStart && _currentState != State.ArrayStart)
|
||||
|
||||
Reference in New Issue
Block a user