浏览代码

Fix to C# support library code

(This was the only use of a HasXyz property for a message type.)
Jon Skeet 5 年之前
父节点
当前提交
ed5c874de3
共有 1 个文件被更改,包括 1 次插入1 次删除
  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.");
             }