Fixed a crash that would happen in the texture set editor when double-clicking on the last texture

This commit is contained in:
biwa 2019-12-19 15:46:02 +01:00
parent 4febbdadf6
commit 9c8f8916e6

View file

@ -550,7 +550,11 @@ namespace CodeImp.DoomBuilder.Controls
// Select specific item?
if(keepselected > -1)
{
list.SetSelectedItem(list.Items[keepselected]);
// If the last item doesn't exist anymore select the new last item
if(keepselected >= list.Items.Count)
list.SetSelectedItem(list.Items[list.Items.Count-1]);
else
list.SetSelectedItem(list.Items[keepselected]);
}
// Select first item?
else if(selectfirst)