diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-03 20:04:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-03 20:04:21 -0500 |
| commit | b2ec5fa70a083b1239b51b0840ef6f8d9db8e7a3 (patch) | |
| tree | 30343ba2f5a807046664cf9611ff402bb9ee4b74 /src/downloadmanager.cpp | |
| parent | 258a9e0f5a0df5973df6e660d24ba6f19fb963f1 (diff) | |
| parent | 43f20f511c2a310af39d06e80a70cbee5684ec4b (diff) | |
Merge pull request #1315 from isanae/download-crash
Handle null plugin when adding a download
Diffstat (limited to 'src/downloadmanager.cpp')
| -rw-r--r-- | src/downloadmanager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 648cfaa2..6817e7e7 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -550,6 +550,16 @@ void DownloadManager::addNXMDownload(const QString &url) validGames.append(m_ManagedGame->validShortNames()); for (auto game : validGames) { MOBase::IPluginGame* gamePlugin = m_OrganizerCore->getGame(game); + + // some game plugins give names in validShortNames() that may refer to other + // plugins, like ttw returning "FalloutNV" and "Fallout3"; if these plugins + // are not loaded, getGame() might return null + if (!gamePlugin) { + // log an error, it's most probably not normal + log::error("no plugin for game '{}', an antivirus might have deleted it", game); + continue; + } + if ( nxmInfo.game().compare(gamePlugin->gameShortName(), Qt::CaseInsensitive) == 0 || nxmInfo.game().compare(gamePlugin->gameNexusName(), Qt::CaseInsensitive) == 0 |
