summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-07-23 14:22:23 +0000
committersr55 <[email protected]>2012-07-23 14:22:23 +0000
commitdaafb500d527e3e5d1a1790bba6dd287c28eedbb (patch)
treee14a14a658efa7678a85b11bb937ce47eaeaabdf /win/CS/HandBrakeWPF
parent503082e5fe7f302dfde51304e53dd68951fcfdb9 (diff)
WinGui: Fix a possible crash after scanning a source.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4871 b64f7644-9d1e-0410-96f1-a4d463321fa5
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();