diff --git a/NAPS2.Console/AutomatedScanning.cs b/NAPS2.Console/AutomatedScanning.cs index 3efab7be70..1362eb3a90 100644 --- a/NAPS2.Console/AutomatedScanning.cs +++ b/NAPS2.Console/AutomatedScanning.cs @@ -127,11 +127,6 @@ public void Execute() } scannedImages = null; - - if (options.WaitForEnter) - { - Console.ReadLine(); - } } private void ImportImages() diff --git a/NAPS2.Console/Program.cs b/NAPS2.Console/Program.cs index db9c84164b..ff6fc75319 100644 --- a/NAPS2.Console/Program.cs +++ b/NAPS2.Console/Program.cs @@ -50,8 +50,12 @@ static void Main(string[] args) } catch (Exception ex) { - KernelManager.Kernel.Get().FatalException("An error occurred that caused the console application to close.", ex); + KernelManager.Kernel.Get() + .FatalException("An error occurred that caused the console application to close.", ex); System.Console.WriteLine(ConsoleResources.UnexpectedError); + } + finally + { if (options.WaitForEnter) { System.Console.ReadLine();