Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Grpc.Core.Api/AuthContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public IEnumerable<AuthProperty> Properties
/// </summary>
public IEnumerable<AuthProperty> FindPropertiesByName(string propertyName)
{
List<AuthProperty> result;
List<AuthProperty>? result;
if (!properties.TryGetValue(propertyName, out result))
{
return Enumerable.Empty<AuthProperty>();
Expand Down
4 changes: 4 additions & 0 deletions src/Grpc.Core.Api/Internal/CodeAnalysisAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#endregion

#if !NET5_0_OR_GREATER

// Content of this file is copied with permission from:
// https://github.com/dotnet/runtime/tree/e2e43f44f1032780fa7c2bb965153c9da615c3d0/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis
// These types are intented to be added as internalized source to libraries and apps that want to
Expand Down Expand Up @@ -148,3 +150,5 @@ internal enum DynamicallyAccessedMemberTypes
/// </summary>
All = ~None
}

#endif
4 changes: 2 additions & 2 deletions src/Grpc.Core.Api/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public byte[] ValueBytes
{
if (valueBytes == null)
{
return EncodingASCII.GetBytes(value);
return EncodingASCII.GetBytes(value!);
}

// defensive copy to guarantee immutability
Expand Down Expand Up @@ -391,7 +391,7 @@ public override string ToString()
/// </summary>
internal byte[] GetSerializedValueUnsafe()
{
return valueBytes ?? EncodingASCII.GetBytes(value);
return valueBytes ?? EncodingASCII.GetBytes(value!);
}

internal bool KeyEqualsIgnoreCase(string key)
Expand Down