Skip to content

Commit c93b611

Browse files
authored
Annotate webencoders with nullable (#22927)
1 parent 416c78b commit c93b611

6 files changed

+6
-3
lines changed

src/WebEncoders/ref/Microsoft.Extensions.WebEncoders.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
55
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
6+
<Nullable>annotations</Nullable>
67
</PropertyGroup>
78
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
89
<Compile Include="Microsoft.Extensions.WebEncoders.netstandard2.0.cs" />

src/WebEncoders/ref/Microsoft.Extensions.WebEncoders.netcoreapp.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.Extensions.WebEncoders
1414
public sealed partial class WebEncoderOptions
1515
{
1616
public WebEncoderOptions() { }
17-
public System.Text.Encodings.Web.TextEncoderSettings TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
17+
public System.Text.Encodings.Web.TextEncoderSettings? TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
1818
}
1919
}
2020
namespace Microsoft.Extensions.WebEncoders.Testing

src/WebEncoders/ref/Microsoft.Extensions.WebEncoders.netstandard2.0.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.Extensions.WebEncoders
1414
public sealed partial class WebEncoderOptions
1515
{
1616
public WebEncoderOptions() { }
17-
public System.Text.Encodings.Web.TextEncoderSettings TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
17+
public System.Text.Encodings.Web.TextEncoderSettings? TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
1818
}
1919
}
2020
namespace Microsoft.Extensions.WebEncoders.Testing

src/WebEncoders/src/Microsoft.Extensions.WebEncoders.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<PackageTags>aspnetcore</PackageTags>
1010
<IsPackable>true</IsPackable>
1111
<IsAspNetCoreApp>true</IsAspNetCoreApp>
12+
<Nullable>enable</Nullable>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

src/WebEncoders/src/WebEncoderOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public sealed class WebEncoderOptions
1616
/// <remarks>
1717
/// If this property is null, then the encoders will use their default allow lists.
1818
/// </remarks>
19-
public TextEncoderSettings TextEncoderSettings { get; set; }
19+
public TextEncoderSettings? TextEncoderSettings { get; set; }
2020
}
2121
}

src/WebEncoders/test/Microsoft.Extensions.WebEncoders.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
5+
<Nullable>enable</Nullable>
56
</PropertyGroup>
67

78
<ItemGroup>

0 commit comments

Comments
 (0)