From 2817b704da45a0a97c768997b3b1ebb8004dfe45 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 1 Jun 2019 13:39:58 +0100 Subject: [PATCH] WinGui: Fix a crash in the AudioViewModel when no Behaviour Tracks or fallback encoder are set. --- win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index aacc4b7d2..610ad478e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -457,7 +457,7 @@ namespace HandBrakeWPF.ViewModels private bool CanAddTrack(AudioBehaviourTrack track, Audio sourceTrack, AudioEncoder fallback) { - if (fallback == AudioEncoder.None) + if (fallback == AudioEncoder.None && track != null) { HBAudioEncoder encoderInfo = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper.GetShortName(track.Encoder)); if (track.IsPassthru && (sourceTrack.Codec & encoderInfo.Id) == 0) -- 2.40.0