1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

CModListView::loadScreenshots(): Check isValid() instead of row() and column()

Co-authored-by: Andrey Filipenkov <kambaladecapitator@gmail.com>
This commit is contained in:
Alexander Wilms 2024-07-19 12:38:42 +02:00 committed by GitHub
parent 4f06aed631
commit 70e309c4f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -962,7 +962,7 @@ void CModListView::loadScreenshots()
{
if(ui->tabWidget->currentIndex() == 2)
{
if(ui->allModsView->currentIndex().row() == -1 || ui->allModsView->currentIndex().column() == -1)
if(!ui->allModsView->currentIndex().isValid())
{
// select the first mod, so we can access its data
ui->allModsView->setCurrentIndex(filterModel->index(0, 0));