Fix RepeatedExtensionValue.IsInitialized

pull/5936/head
Sydney Acksman 6 years ago
parent ebf0bfaed8
commit b78330b21d
  1. 18
      csharp/src/Google.Protobuf/ExtensionValue.cs

@ -213,7 +213,23 @@ namespace Google.Protobuf
public bool IsInitialized()
{
return field.All(m => m is IMessage && (m as IMessage).IsInitialized());
for (int i = 0; i < field.Count; i++)
{
var element = field[i];
if (element is IMessage)
{
if (!(element as IMessage).IsInitialized())
{
return false;
}
}
else
{
break;
}
}
return true;
}
}
}

Loading…
Cancel
Save