From: sr55 Date: Sat, 1 Jun 2019 12:39:58 +0000 (+0100) Subject: WinGui: Fix a crash in the AudioViewModel when no Behaviour Tracks or fallback encode... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2817b704da45a0a97c768997b3b1ebb8004dfe45;p=handbrake WinGui: Fix a crash in the AudioViewModel when no Behaviour Tracks or fallback encoder are set. --- 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)