Fixed NullReferenceException when accessing FieldDescriptor.IsPacked

pull/9430/head
Alexandre Mutel 3 years ago
parent 41e22cde8d
commit 16941420c9
  1. 3
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

@ -239,7 +239,8 @@ namespace Google.Protobuf.Reflection
}
else
{
return !Proto.Options.HasPacked || Proto.Options.Packed;
// Packed by default with proto3
return Proto.Options == null || !Proto.Options.HasPacked || Proto.Options.Packed;
}
}
}

Loading…
Cancel
Save