Skip to content

Commit

Permalink
Cleanup some dead code and one instance of null propagation in toolin…
Browse files Browse the repository at this point in the history
…g NOT userfacing code (#2280)
  • Loading branch information
Mpdreamz authored Feb 5, 2024
1 parent d598dff commit cd46f5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Elastic.Apm.Specification/Validator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private static ImplementationProperty[] GetProperties(Type specType)
continue;

var implementationProperty = new ImplementationProperty(jsonProperty.PropertyName, jsonProperty.PropertyType, specType);
var maxLength = (MaxLengthAttribute)(jsonProperty.AttributeProvider.GetAttributes(typeof(MaxLengthAttribute), true).FirstOrDefault());
var maxLength = (MaxLengthAttribute)jsonProperty.AttributeProvider?.GetAttributes(typeof(MaxLengthAttribute), true).FirstOrDefault();

if (maxLength != null)
implementationProperty.MaxLength = maxLength.Length;
Expand Down
15 changes: 5 additions & 10 deletions src/integrations/Elastic.Apm.AspNetCore/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using Microsoft.AspNetCore.Http.Features;
namespace Elastic.Apm.AspNetCore;

namespace Elastic.Apm.AspNetCore
internal static class Consts
{
internal static class Consts
internal static class OpenIdClaimTypes
{
internal static class OpenIdClaimTypes
{
internal const string Email = "email";
internal const string UserId = "sub";
}

internal static FormOptions FormContentOptions => new FormOptions { BufferBody = true };
internal const string Email = "email";
internal const string UserId = "sub";
}
}

0 comments on commit cd46f5b

Please sign in to comment.