Merge pull request #9430 from xoofx/fix-csharp-fielddesc-ispacked

Fixes NullReferenceException when accessing FieldDescriptor.IsPacked
pull/9459/head
deannagarcia 3 years ago committed by GitHub
commit c756e61878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

@ -247,7 +247,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