mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
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:
+5
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user