aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2018-03-20 15:19:42 -0700
committerGravatar GitHub <noreply@github.com>2018-03-20 15:19:42 -0700
commit88a4884b55cf1a2a6576af0d558d2abe03ec6ba8 (patch)
tree4cc287cf181bf854e5dc77a8dd0d14077d62c18c /csharp/src/Google.Protobuf
parentd6a17aadeb6fc306d3d8c3b5c07edc41f6bc551e (diff)
parent5140bae3834c40208e44b1eeb947485a832387a7 (diff)
Merge pull request #4345 from jskeet/list-json-null
Allow null value in JSON representation of ListValue
Diffstat (limited to 'csharp/src/Google.Protobuf')
-rw-r--r--csharp/src/Google.Protobuf/JsonParser.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/csharp/src/Google.Protobuf/JsonParser.cs b/csharp/src/Google.Protobuf/JsonParser.cs
index 3621b0c0..284bce93 100644
--- a/csharp/src/Google.Protobuf/JsonParser.cs
+++ b/csharp/src/Google.Protobuf/JsonParser.cs
@@ -264,11 +264,12 @@ namespace Google.Protobuf
return;
}
tokenizer.PushBack(token);
- if (token.Type == JsonToken.TokenType.Null)
+ object value = ParseSingleValue(field, tokenizer);
+ if (value == null)
{
throw new InvalidProtocolBufferException("Repeated field elements cannot be null");
}
- list.Add(ParseSingleValue(field, tokenizer));
+ list.Add(value);
}
}