Skip to content

Commit e657de4

Browse files
Fix null warnings (#22615)
1 parent 8cc9ee1 commit e657de4

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

src/Shared/Shared.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 16
3+
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.0.0
55
MinimumVisualStudioVersion = 16.0.0.0
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Shared.Tests", "test\Shared.Tests\Microsoft.AspNetCore.Shared.Tests.csproj", "{06CD38EF-7733-4284-B3E4-825B6B63E1DD}"
77
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThrowingLibrary", "test\testassets\ThrowingLibrary\ThrowingLibrary.csproj", "{4799E505-5F83-4AB3-B96D-EACEB3528854}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
1517
{06CD38EF-7733-4284-B3E4-825B6B63E1DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{06CD38EF-7733-4284-B3E4-825B6B63E1DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{06CD38EF-7733-4284-B3E4-825B6B63E1DD}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{4799E505-5F83-4AB3-B96D-EACEB3528854}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

src/Shared/StackTrace/StackFrame/ParameterDisplayInfo.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.Text;
5+
#nullable enable
56

67
namespace Microsoft.Extensions.StackTrace.Sources
78
{
89
internal class ParameterDisplayInfo
910
{
10-
public string Name { get; set; }
11+
public string? Name { get; set; }
1112

12-
public string Type { get; set; }
13+
public string? Type { get; set; }
1314

14-
public string Prefix { get; set; }
15+
public string? Prefix { get; set; }
1516

1617
public override string ToString()
1718
{
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.Diagnostics;
5+
#nullable enable
56

67
namespace Microsoft.Extensions.StackTrace.Sources
78
{
89
internal class StackFrameInfo
910
{
1011
public int LineNumber { get; set; }
1112

12-
public string FilePath { get; set; }
13+
public string? FilePath { get; set; }
1314

14-
public StackFrame StackFrame { get; set; }
15+
public StackFrame? StackFrame { get; set; }
1516

16-
public MethodDisplayInfo MethodDisplayInfo { get; set; }
17+
public MethodDisplayInfo? MethodDisplayInfo { get; set; }
1718
}
1819
}

src/Shared/StackTrace/StackFrame/StackTraceHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static IList<StackFrameInfo> GetFrames(Exception exception, out Aggregate
132132
parameterType = parameterType.GetElementType();
133133
}
134134

135-
parameterTypeString = TypeNameHelper.GetTypeDisplayName(parameterType, fullName: false, includeGenericParameterNames: true);
135+
parameterTypeString = TypeNameHelper.GetTypeDisplayName(parameterType!, fullName: false, includeGenericParameterNames: true);
136136
}
137137

138138
return new ParameterDisplayInfo

0 commit comments

Comments
 (0)