diff --git a/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs b/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs index 48f72438eb2c..27aaf67ea178 100644 --- a/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs +++ b/src/Shared/StackTrace/StackFrame/StackTraceHelper.cs @@ -10,12 +10,13 @@ using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using Microsoft.Extensions.Internal; +#nullable enable namespace Microsoft.Extensions.StackTrace.Sources { internal class StackTraceHelper { - public static IList GetFrames(Exception exception, out AggregateException error) + public static IList GetFrames(Exception exception, out AggregateException? error) { var frames = new List(); @@ -35,7 +36,7 @@ public static IList GetFrames(Exception exception, out Aggregate return frames; } - List exceptions = null; + List? exceptions = null; for (var i = 0; i < stackFrames.Length; i++) { @@ -69,7 +70,7 @@ public static IList GetFrames(Exception exception, out Aggregate return frames; } - internal static MethodDisplayInfo GetMethodDisplayString(MethodBase method) + internal static MethodDisplayInfo? GetMethodDisplayString(MethodBase? method) { // Special case: no method available if (method == null) @@ -145,7 +146,7 @@ internal static MethodDisplayInfo GetMethodDisplayString(MethodBase method) return methodDisplayInfo; } - private static bool ShowInStackTrace(MethodBase method) + private static bool ShowInStackTrace(MethodBase? method) { Debug.Assert(method != null); @@ -191,7 +192,7 @@ private static bool ShowInStackTrace(MethodBase method) return true; } - private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType) + private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type? declaringType) { Debug.Assert(method != null); Debug.Assert(method.DeclaringType != null);