summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index c1df4b8be..30f884779 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -634,11 +634,11 @@ namespace HandBrakeWPF.ViewModels
}
set
{
- if (!Equals(this.selectedTitle, value))
+ if (!object.Equals(this.selectedTitle, value))
{
this.selectedTitle = value;
- if (selectedTitle == null)
+ if (this.selectedTitle == null)
{
return;
}
@@ -652,7 +652,11 @@ namespace HandBrakeWPF.ViewModels
// Default the Start and End Point dropdowns
this.SelectedStartPoint = 1;
- this.SelectedEndPoint = selectedTitle.Chapters.Last().ChapterNumber;
+ this.SelectedEndPoint = this.selectedTitle.Chapters != null &&
+ this.selectedTitle.Chapters.Count != 0
+ ? this.selectedTitle.Chapters.Last().ChapterNumber
+ : 1;
+
this.SelectedPointToPoint = PointToPointMode.Chapters;
this.SelectedAngle = 1;
@@ -662,7 +666,7 @@ namespace HandBrakeWPF.ViewModels
}
this.NotifyOfPropertyChange(() => this.CurrentTask);
- this.Duration = selectedTitle.Duration.ToString();
+ this.Duration = this.selectedTitle.Duration.ToString();
// Setup the tab controls
this.SetupTabs();