From b2176395d7ff74edf112126893ece8c9e4681ac4 Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 14 May 2012 00:13:56 +0000 Subject: WinGui: Fix a crash in the user settings service on a clean install. Also handle exception throwing a bit better in the encode service. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4673 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrake.ApplicationServices/Services/Encode.cs | 4 +++- win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs | 5 ----- win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs | 6 +++++- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices') diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs index ade0f5e29..cb920a862 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs @@ -174,9 +174,11 @@ namespace HandBrake.ApplicationServices.Services } catch (Exception exc) { + encodeQueueTask.Status = QueueItemStatus.Error; this.Invoke_encodeCompleted( new EncodeCompletedEventArgs( - false, exc, "An Error occured when trying to encode this source. ")); + false, null, "An Error occured when trying to encode this source. ")); + throw; } } diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index 1deeb0d44..7e67368e3 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -216,11 +216,6 @@ namespace HandBrake.ApplicationServices.Services { this.QueueManager.LastProcessedJob.Status = QueueItemStatus.Error; this.Pause(); - if (e.Exception.GetType() == typeof(GeneralApplicationException)) - { - throw e.Exception; - } - throw new GeneralApplicationException(e.ErrorInformation, e.Exception.Message, e.Exception); } // Handling Log Data diff --git a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs index fa8408649..7fe50cd04 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs @@ -136,6 +136,10 @@ namespace HandBrake.ApplicationServices.Services SerializableDictionary data = (SerializableDictionary)serializer.Deserialize(reader); this.userSettings = data; } + } + else + { + this.userSettings = new SerializableDictionary(); } // Add any missing / new settings @@ -146,7 +150,7 @@ namespace HandBrake.ApplicationServices.Services this.Save(); } } - catch (Exception) + catch (Exception exc) { try { -- cgit v1.2.3