diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 13 |
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;
}
}
|