1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-08 22:26:51 +02:00

Fix crash on attempt to update mod that depends on unknown mod

This commit is contained in:
Ivan Savenko
2025-01-01 21:01:23 +00:00
parent 698d43e195
commit ea0c553148

View File

@@ -1053,7 +1053,13 @@ QStringList CModListView::getUpdateableMods()
for(const auto & modName : modStateModel->getAllMods())
{
auto mod = modStateModel->getMod(modName);
if (mod.isUpdateAvailable())
if (!mod.isUpdateAvailable())
continue;
QStringList notInstalledDependencies = getModsToInstall(mod.getID());
QStringList unavailableDependencies = findUnavailableMods(notInstalledDependencies);
if (unavailableDependencies.empty())
result.push_back(modName);
}