diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-11-12 00:18:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 00:18:41 -0500 |
| commit | f7de8618124199977c4f4919e70bbfd2693ed341 (patch) | |
| tree | 7d97a55fff255c7ab1311cf477a4f209fbfcc41d /src | |
| parent | e1dceec67a53f5332b2f92ac2901309f0c0ed882 (diff) | |
| parent | a0c26517028a25ccd39dc92f9da8539f25db85fc (diff) | |
Merge pull request #1293 from isanae/master
Crash when highlighting plugins from the Data directory
Diffstat (limited to 'src')
| -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); |
