Commit e7283254 authored by Sydney Acksman's avatar Sydney Acksman Committed by Jie Luo

Change MessageType != null in IsInitialized to FieldType == Message || Group (#5688)

parent 39c09478
...@@ -163,12 +163,12 @@ namespace Google.Protobuf ...@@ -163,12 +163,12 @@ namespace Google.Protobuf
var map = (IDictionary)f.Accessor.GetValue(message); var map = (IDictionary)f.Accessor.GetValue(message);
return map.Values.OfType<IMessage>().All(IsInitialized); return map.Values.OfType<IMessage>().All(IsInitialized);
} }
else if (f.IsRepeated && f.MessageType != null) else if (f.IsRepeated && f.FieldType == FieldType.Message || f.FieldType == FieldType.Group)
{ {
var enumerable = (IEnumerable)f.Accessor.GetValue(message); var enumerable = (IEnumerable)f.Accessor.GetValue(message);
return enumerable.Cast<IMessage>().All(IsInitialized); return enumerable.Cast<IMessage>().All(IsInitialized);
} }
else if (f.MessageType != null) else if (f.FieldType == FieldType.Message || f.FieldType == FieldType.Group)
{ {
if (f.Accessor.HasValue(message)) if (f.Accessor.HasValue(message))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment