diff --git a/csharp/src/Google.Protobuf/ExtensionValue.cs b/csharp/src/Google.Protobuf/ExtensionValue.cs index 6b224ed441..986b2fce0d 100644 --- a/csharp/src/Google.Protobuf/ExtensionValue.cs +++ b/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; } } }