diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-03-25 04:42:02 -0500 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2019-03-25 04:42:02 -0500 |
| commit | eb9ac6ca246c13a4f7d6d60a9ec3e9018fe209e8 (patch) | |
| tree | 37fc9eac0bd82abf03a43f8594d535b95deddd0d /src/downloadmanager.cpp | |
| parent | 043a5fa9412f1d766f5f211beabf4bda8afab73a (diff) | |
Add more protection against missing game plugins
Diffstat (limited to 'src/downloadmanager.cpp')
| -rw-r--r-- | src/downloadmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 3fa282da..25542ef3 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -453,7 +453,7 @@ void DownloadManager::removePending(QString gameName, int modID, int fileID) games += m_ManagedGame->gameShortName(); for (auto game : games) { MOBase::IPluginGame *gamePlugin = m_OrganizerCore->getGame(game); - if (gamePlugin->gameNexusName().compare(gameName, Qt::CaseInsensitive) == 0) { + if (gamePlugin != nullptr && gamePlugin->gameNexusName().compare(gameName, Qt::CaseInsensitive) == 0) { gameShortName = gamePlugin->gameShortName(); break; } @@ -1640,7 +1640,7 @@ void DownloadManager::nxmFileInfoAvailable(QString gameName, int modID, int file games += m_ManagedGame->gameShortName(); for (auto game : games) { MOBase::IPluginGame *gamePlugin = m_OrganizerCore->getGame(game); - if (gamePlugin->gameNexusName().compare(gameName, Qt::CaseInsensitive) == 0) { + if (gamePlugin != nullptr && gamePlugin->gameNexusName().compare(gameName, Qt::CaseInsensitive) == 0) { info->gameName = gamePlugin->gameShortName(); } } @@ -1815,7 +1815,7 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use games += m_ManagedGame->gameShortName(); for (auto game : games) { MOBase::IPluginGame *gamePlugin = m_OrganizerCore->getGame(game); - if (gamePlugin->gameNexusName().compare(gameName, Qt::CaseInsensitive) == 0) { + if (gamePlugin != nullptr && gamePlugin->gameNexusName().compare(gameName, Qt::CaseInsensitive) == 0) { gameShortName = gamePlugin->gameShortName(); break; } |
