highlighting plugins from the data directory would crash

the mod name is "data" and getByName() crashes with a mod name that doesn't exist
This commit is contained in:
isanae
2020-11-12 00:17:36 -05:00
parent e1dceec67a
commit a0c2651702
+5 -3
View File
@@ -860,9 +860,11 @@ void ModList::highlightMods(const QItemSelectionModel *selection, const MOShared
if (fileEntry.get() != nullptr) {
QString originName = QString::fromStdWString(directoryEntry.getOriginByID(fileEntry->getOrigin()).getName());
auto modInfo = ModInfo::getByName(originName);
modInfo->setPluginSelected(true);
const auto index = ModInfo::getIndex(originName);
if (index != UINT_MAX) {
auto modInfo = ModInfo::getByIndex(index);
modInfo->setPluginSelected(true);
}
}
}
notifyChange(0, rowCount() - 1);