Fix crash while translating subtitles - thx claudemartin :)

Fix #8901
This commit is contained in:
Nikolaj Olsson 2024-10-12 09:27:13 +02:00
parent 172b47cdcb
commit 7c9c32c5dc

View File

@ -1380,8 +1380,14 @@ namespace Nikse.SubtitleEdit.Forms.Translate
private static void SyncListViews(ListView listViewSelected, SubtitleListView listViewOther)
{
if (listViewSelected.SelectedItems.Count > 0)
if (listViewSelected == null ||
listViewOther == null ||
listViewSelected.SelectedItems.Count == 0 ||
listViewSelected.TopItem == null)
{
return;
}
var first = listViewSelected.TopItem.Index;
var index = listViewSelected.SelectedItems[0].Index;
if (index < listViewOther.Items.Count)
@ -1393,7 +1399,6 @@ namespace Nikse.SubtitleEdit.Forms.Translate
}
}
}
}
private void subtitleListViewSource_DoubleClick(object sender, EventArgs e)
{