From bab9e4598474b2af5449126632cd17129276eb2a Mon Sep 17 00:00:00 2001 From: Ben Olden-Cooligan Date: Wed, 10 Jun 2015 16:53:44 -0400 Subject: [PATCH] Move use of console option WaitForEnter for consistency on all errors --- NAPS2.Console/AutomatedScanning.cs | 5 ----- NAPS2.Console/Program.cs | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) 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();