Skip to content

Commit

Permalink
Fix #185
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnamed434 committed Aug 10, 2024
1 parent 47e574a commit 455a82b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/BitMono.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ private static async Task<int> Main(string[] args)
return statusCode;
}

CancellationTokenSource.Token.ThrowIfCancellationRequested();

if (obfuscation.ClearCLI)
{
Console.Clear();
Expand All @@ -62,7 +64,14 @@ private static async Task<int> Main(string[] args)

if (obfuscation.OpenFileDestinationInFileExplorer)
{
Process.Start(needs.OutputPath);
try
{
Process.Start(needs.OutputPath);
}
catch (Exception ex)
{
logger.Error(ex, "An error occured while opening the destination file in explorer!");
}
}
}
catch (OperationCanceledException)
Expand All @@ -83,7 +92,7 @@ private static async Task<int> Main(string[] args)
return statusCode;
}

private static void OnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
private static void OnCancelKeyPress(object? sender, ConsoleCancelEventArgs e)
{
CancellationTokenSource.Cancel();
e.Cancel = true;
Expand Down

0 comments on commit 455a82b

Please sign in to comment.