mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-04 23:17:41 +02:00
Merge pull request #4297 from Alexander-Wilms/mod-assertion
CModListView::loadScreenshots(): Ensure a mod is selected in allModsView
This commit is contained in:
commit
1cbfa43b6d
@ -962,6 +962,12 @@ void CModListView::loadScreenshots()
|
||||
{
|
||||
if(ui->tabWidget->currentIndex() == 2)
|
||||
{
|
||||
if(!ui->allModsView->currentIndex().isValid())
|
||||
{
|
||||
// select the first mod, so we can access its data
|
||||
ui->allModsView->setCurrentIndex(filterModel->index(0, 0));
|
||||
}
|
||||
|
||||
ui->screenshotsList->clear();
|
||||
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
||||
assert(modModel->hasMod(modName)); //should be filtered out by check above
|
||||
|
Loading…
x
Reference in New Issue
Block a user