mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	(#922) fixed ArgumentNullException on .NET Framework
It seems, when Spectre.Console is compiled for netstandard2.0, StackTrace.GetFrames() returns null instead of an empty array.
This commit is contained in:
		 Nils Andresen
					Nils Andresen
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						parent
						
							3a7b8aa1d2
						
					
				
				
					commit
					9d985f0f0a
				
			| @@ -221,9 +221,9 @@ internal static class ExceptionFormatter | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     private static IEnumerable<StackFrame> FilterStackFrames(this IEnumerable<StackFrame?> frames) | ||||
|     private static IEnumerable<StackFrame> FilterStackFrames(this IEnumerable<StackFrame?>? frames) | ||||
|     { | ||||
|         var allFrames = frames.ToArray(); | ||||
|         var allFrames = frames?.ToArray() ?? Array.Empty<StackFrame>(); | ||||
|         var numberOfFrames = allFrames.Length; | ||||
|  | ||||
|         for (var i = 0; i < numberOfFrames; i++) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user