Skip to content

Commit 22ac73b

Browse files
authored
Fix build failure on benchmark server (#1913)
1 parent e7fd800 commit 22ac73b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Grpc.Core.Api/AuthContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public IEnumerable<AuthProperty> Properties
101101
/// </summary>
102102
public IEnumerable<AuthProperty> FindPropertiesByName(string propertyName)
103103
{
104-
List<AuthProperty> result;
104+
List<AuthProperty>? result;
105105
if (!properties.TryGetValue(propertyName, out result))
106106
{
107107
return Enumerable.Empty<AuthProperty>();

src/Grpc.Core.Api/Internal/CodeAnalysisAttributes.cs

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#endregion
1818

19+
#if !NET5_0_OR_GREATER
20+
1921
// Content of this file is copied with permission from:
2022
// https://github.com/dotnet/runtime/tree/e2e43f44f1032780fa7c2bb965153c9da615c3d0/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis
2123
// These types are intented to be added as internalized source to libraries and apps that want to
@@ -148,3 +150,5 @@ internal enum DynamicallyAccessedMemberTypes
148150
/// </summary>
149151
All = ~None
150152
}
153+
154+
#endif

src/Grpc.Core.Api/Metadata.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public byte[] ValueBytes
338338
{
339339
if (valueBytes == null)
340340
{
341-
return EncodingASCII.GetBytes(value);
341+
return EncodingASCII.GetBytes(value!);
342342
}
343343

344344
// defensive copy to guarantee immutability
@@ -391,7 +391,7 @@ public override string ToString()
391391
/// </summary>
392392
internal byte[] GetSerializedValueUnsafe()
393393
{
394-
return valueBytes ?? EncodingASCII.GetBytes(value);
394+
return valueBytes ?? EncodingASCII.GetBytes(value!);
395395
}
396396

397397
internal bool KeyEqualsIgnoreCase(string key)

0 commit comments

Comments
 (0)