Browse Source

Fix to C# support library code

(This was the only use of a HasXyz property for a message type.)
Jon Skeet 5 years ago
parent
commit
ed5c874de3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

+ 1 - 1
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.");
             }