Skip to content

Commit

Permalink
Update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon committed Nov 29, 2024
1 parent c220817 commit d8ae56e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ internal PayloadItemSerializer() =>
{
foreach (var prop in j.Properties)
{
var maxLengthAttribute = prop.AttributeProvider.GetCustomAttributes(typeof(MaxLengthAttribute), false).FirstOrDefault() as MaxLengthAttribute;
if (maxLengthAttribute != null)
if (prop.AttributeProvider.GetCustomAttributes(typeof(MaxLengthAttribute), false).FirstOrDefault() is MaxLengthAttribute maxLengthAttribute)
prop.CustomConverter = new TruncateJsonConverter(maxLengthAttribute.Length);

if (prop.PropertyType == typeof(Lazy<Context>))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ private async Task ParsePayloadLineAndAddToReceivedData(string line)
new JsonSerializerOptions
{
UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow,
});

if (payload is null)
throw new ArgumentException("Deserialization failed");
}) ?? throw new ArgumentException("Deserialization failed");

await HandleParsed(nameof(payload.Error), payload.Error, _mockApmServer.ReceivedData.Errors, _mockApmServer.AddError);
await HandleParsed(nameof(payload.Metadata), payload.Metadata, _mockApmServer.ReceivedData.Metadata, _mockApmServer.AddMetadata);
Expand Down

0 comments on commit d8ae56e

Please sign in to comment.