mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	fix some nullability issues
This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							79742ce9e3
						
					
				
				
					commit
					e71db7f78c
				
			@@ -34,11 +34,6 @@ namespace Spectre.Console
 | 
			
		||||
 | 
			
		||||
        private static void Render(IAnsiConsole console, RenderContext options, IEnumerable<IRenderable> renderables)
 | 
			
		||||
        {
 | 
			
		||||
            if (renderables is null)
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var result = new List<Segment>();
 | 
			
		||||
            foreach (var renderable in renderables)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ namespace Spectre.Console
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="text">The text to escape.</param>
 | 
			
		||||
        /// <returns>A string that is safe to use in markup.</returns>
 | 
			
		||||
        public static string EscapeMarkup(this string text)
 | 
			
		||||
        public static string EscapeMarkup(this string? text)
 | 
			
		||||
        {
 | 
			
		||||
            if (text == null)
 | 
			
		||||
            {
 | 
			
		||||
@@ -45,7 +45,7 @@ namespace Spectre.Console
 | 
			
		||||
            return Cell.GetCellLength(context, text);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        internal static string Capitalize(this string text, CultureInfo? culture = null)
 | 
			
		||||
        internal static string Capitalize(this string? text, CultureInfo? culture = null)
 | 
			
		||||
        {
 | 
			
		||||
            if (text == null)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -96,11 +96,6 @@ namespace Spectre.Console
 | 
			
		||||
                throw new ArgumentNullException(nameof(style));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (source is null)
 | 
			
		||||
            {
 | 
			
		||||
                return style;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var current = style;
 | 
			
		||||
            foreach (var item in source)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user