summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-02-15 22:25:34 +0000
committersr55 <[email protected]>2020-02-15 22:25:34 +0000
commit970f2955fd40fc66d55f4dcab769ed9afbf3cb49 (patch)
treeb31b22e3320e9a0a9a99d351f144871173ca577d /win
parent597e834963057c9ea52cb95e994ad4cbce0d8158 (diff)
WinGui: Make the error information clearer when the user imports a preset with invalid audio encoders set. #2638
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs
index 35bd86c39..5ad0ef13e 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs
@@ -347,7 +347,9 @@ namespace HandBrakeWPF.Services.Encode.Factories
audio.CopyMask = copyMaskList.ToArray();
HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));
- audio.FallbackEncoder = audioEncoder.ShortName;
+ audio.FallbackEncoder = audioEncoder?.ShortName;
+
+ Validate.NotNull(audio.FallbackEncoder, string.Format("Unrecognized audio encoder: {0} \n", job.AllowedPassthruOptions.AudioEncoderFallback));
audio.AudioList = new List<HandBrake.Interop.Interop.Json.Encode.AudioTrack>();
foreach (AudioTrack item in job.AudioTracks)