summaryrefslogtreecommitdiff
path: root/src/directoryrefresher.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-05-01 17:31:37 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2020-05-07 12:16:32 +0200
commitcd2b7683b78503d4fef1946de088108b812b387c (patch)
treee5948592688f62ae0b0c00bd7fd7338fb7cfcb33 /src/directoryrefresher.cpp
parent14d1ea87f99ad92886b428272fc99be6478e9ba6 (diff)
Avoid using GamePlugins when not provided by the game plugin.
Diffstat (limited to 'src/directoryrefresher.cpp')
-rw-r--r--src/directoryrefresher.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp
index 0369b1b0..383e6b33 100644
--- a/src/directoryrefresher.cpp
+++ b/src/directoryrefresher.cpp
@@ -216,9 +216,12 @@ void DirectoryRefresher::addModBSAToStructure(
{
const IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
- GamePlugins *gamePlugins = game->feature<GamePlugins>();
QStringList loadOrder = QStringList();
- gamePlugins->getLoadOrder(loadOrder);
+
+ GamePlugins* gamePlugins = game->feature<GamePlugins>();
+ if (gamePlugins) {
+ gamePlugins->getLoadOrder(loadOrder);
+ }
std::vector<std::wstring> lo;
for (auto&& s : loadOrder) {
@@ -364,9 +367,11 @@ struct ModThread
if (Settings::instance().archiveParsing()) {
const IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
- GamePlugins *gamePlugins = game->feature<GamePlugins>();
QStringList loadOrder = QStringList();
- gamePlugins->getLoadOrder(loadOrder);
+ GamePlugins* gamePlugins = game->feature<GamePlugins>();
+ if (gamePlugins) {
+ gamePlugins->getLoadOrder(loadOrder);
+ }
std::vector<std::wstring> lo;
for (auto&& s : loadOrder) {