summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index 859763d3f..b279f95c5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -160,7 +160,6 @@ namespace HandBrakeWPF.ViewModels
}
}
-
/// <summary>
/// Gets or sets the subtitle behaviours.
/// </summary>
@@ -264,7 +263,6 @@ namespace HandBrakeWPF.ViewModels
: LanguageUtilities.GetLanguageCodes(
this.SubtitleBehaviours.SelectedLangauges.ToArray());
-
List<Subtitle> availableTracks =
this.SourceTracks.Where(subtitle => iso6392Codes.Contains(subtitle.LanguageCodeClean)).ToList();
@@ -289,7 +287,6 @@ namespace HandBrakeWPF.ViewModels
bool foundLanguage = false;
Subtitle track = sourceTrack;
-
foreach (var item in this.Task.SubtitleTracks)
{
if (item.SourceTrack != null && item.SourceTrack.LanguageCode != null && track.LanguageCode.Contains(item.SourceTrack.LanguageCode))
@@ -606,7 +603,11 @@ namespace HandBrakeWPF.ViewModels
}
}
- this.Task.SubtitleTracks.Add(track);
+ var encodeTask = this.Task;
+ if (encodeTask != null)
+ {
+ encodeTask.SubtitleTracks.Add(track);
+ }
}
/// <summary>