From 7d58436249e353809f58c0373f95b06e6c531253 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 7 Dec 2008 23:24:27 +0000 Subject: WinGui: - Fixes an issue where if there are no presets, that is, the user removed them all, then the GUI would throw a null pointer exception after scanning a source. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2016 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'win/C#/frmMain.cs') diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 54a698f5e..f70643731 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -709,12 +709,15 @@ namespace Handbrake drp_track1Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray()); drp_track1Audio.SelectedIndex = 0; - if (!treeView_presets.SelectedNode.Text.Contains("AppleTV")) + if (treeView_presets.Nodes.Count != 0) { - drp_track2Audio.Items.Clear(); - drp_track2Audio.Items.Add("None"); - drp_track2Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray()); - drp_track2Audio.SelectedIndex = 0; + if (!treeView_presets.SelectedNode.Text.Contains("AppleTV")) + { + drp_track2Audio.Items.Clear(); + drp_track2Audio.Items.Add("None"); + drp_track2Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray()); + drp_track2Audio.SelectedIndex = 0; + } } drp_track3Audio.Items.Clear(); -- cgit v1.2.3