summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-11-27 16:32:13 +0000
committersr55 <[email protected]>2012-11-27 16:32:13 +0000
commitf93ce617afdba769738f8be17e3f80391231b822 (patch)
treec5a73207ada9cba874c5f36d16bb534f3cf3fa44 /win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
parent2c09426fd20474250645429d4526c1191f6a8cf4 (diff)
WinGui: General code tidy-up and fix a couple of possible points that could throw exceptions.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5083 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
index 2633b5885..a64378a49 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
@@ -147,7 +147,7 @@ namespace HandBrakeWPF.ViewModels
public bool CanClose()
{
IQueueProcessor processor = IoC.Get<IQueueProcessor>();
- if (processor.EncodeService.IsEncoding)
+ if (processor != null && processor.EncodeService.IsEncoding)
{
MessageBoxResult result =
errorService.ShowMessageBox(
@@ -160,13 +160,20 @@ namespace HandBrakeWPF.ViewModels
{
processor.Pause();
processor.EncodeService.Stop();
- this.MainViewModel.Shutdown();
+ if (this.MainViewModel != null)
+ {
+ this.MainViewModel.Shutdown();
+ }
+
return true;
}
return false;
}
- this.MainViewModel.Shutdown();
+ if (this.MainViewModel != null)
+ {
+ this.MainViewModel.Shutdown();
+ }
return true;
}
}