Skip to content

Commit 6bdbe36

Browse files
committed
Update formatting
1 parent ad423c7 commit 6bdbe36

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Elastic.Apm/Report/Serialization/PayloadItemSerializer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ internal PayloadItemSerializer() =>
4545
{
4646
foreach (var prop in j.Properties)
4747
{
48-
var maxLengthAttribute = prop.AttributeProvider.GetCustomAttributes(typeof(MaxLengthAttribute), false).FirstOrDefault() as MaxLengthAttribute;
49-
if (maxLengthAttribute != null)
48+
if (prop.AttributeProvider.GetCustomAttributes(typeof(MaxLengthAttribute), false).FirstOrDefault() is MaxLengthAttribute maxLengthAttribute)
5049
prop.CustomConverter = new TruncateJsonConverter(maxLengthAttribute.Length);
5150

5251
if (prop.PropertyType == typeof(Lazy<Context>))

test/Elastic.Apm.Tests.MockApmServer/Controllers/IntakeV2EventsController.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ private async Task ParsePayloadLineAndAddToReceivedData(string line)
105105
new JsonSerializerOptions
106106
{
107107
UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow,
108-
});
109-
110-
if (payload is null)
111-
throw new ArgumentException("Deserialization failed");
108+
}) ?? throw new ArgumentException("Deserialization failed");
112109

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

0 commit comments

Comments
 (0)