Fix to C# support library code

(This was the only use of a HasXyz property for a message type.)
pull/7455/head
Jon Skeet 5 years ago committed by Jon Skeet
parent 9926c9504b
commit ed5c874de3
  1. 2
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

@ -394,7 +394,7 @@ namespace Google.Protobuf.Reflection
File.DescriptorPool.AddFieldByNumber(this);
if (ContainingType != null && ContainingType.Proto.HasOptions && ContainingType.Proto.Options.MessageSetWireFormat)
if (ContainingType != null && ContainingType.Proto.Options != null && ContainingType.Proto.Options.MessageSetWireFormat)
{
throw new DescriptorValidationException(this, "MessageSet format is not supported.");
}

Loading…
Cancel
Save