From eb9ac6ca246c13a4f7d6d60a9ec3e9018fe209e8 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Mon, 25 Mar 2019 04:42:02 -0500 Subject: Add more protection against missing game plugins --- src/downloadmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/downloadmanager.cpp') 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; } -- cgit v1.3.1