diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-12 00:17:36 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-12 00:17:36 -0500 |
| commit | a0c26517028a25ccd39dc92f9da8539f25db85fc (patch) | |
| tree | 7d97a55fff255c7ab1311cf477a4f209fbfcc41d | |
| parent | e1dceec67a53f5332b2f92ac2901309f0c0ed882 (diff) | |
highlighting plugins from the data directory would crash
the mod name is "data" and getByName() crashes with a mod name that doesn't exist
| -rw-r--r-- | src/modlist.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index 04abfb01..d7324e7f 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -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); |
