From 1b2bcf771ddf59ae36d798f058043e02bb8ee941 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Tue, 26 Sep 2023 00:13:22 +0300 Subject: [PATCH] Add fallback for progress tasks without name in CLI Closes #1133 --- .../Utils/Extensions/ConsoleExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs b/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs index 792d71e..0d6570c 100644 --- a/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs +++ b/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs @@ -36,9 +36,13 @@ internal static class ConsoleExtensions Func performOperationAsync ) { + // Description cannot be empty + // https://github.com/Tyrrrz/DiscordChatExporter/issues/1133 + var actualDescription = !string.IsNullOrWhiteSpace(description) ? description : "?"; + var progressTask = progressContext.AddTask( // Don't recognize random square brackets as style tags - Markup.Escape(description), + Markup.Escape(actualDescription), new ProgressTaskSettings { MaxValue = 1 } );