summaryrefslogtreecommitdiff
path: root/src/pluginlist.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/pluginlist.cpp
parent14d1ea87f99ad92886b428272fc99be6478e9ba6 (diff)
Avoid using GamePlugins when not provided by the game plugin.
Diffstat (limited to 'src/pluginlist.cpp')
-rw-r--r--src/pluginlist.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp
index 1f320982..c2667557 100644
--- a/src/pluginlist.cpp
+++ b/src/pluginlist.cpp
@@ -185,7 +185,8 @@ void PluginList::refresh(const QString &profileName
ChangeBracket<PluginList> layoutChange(this);
QStringList primaryPlugins = m_GamePlugin->primaryPlugins();
- bool lightPluginsAreSupported = m_GamePlugin->feature<GamePlugins>()->lightPluginsAreSupported();
+ GamePlugins *gamePlugins = m_GamePlugin->feature<GamePlugins>();
+ const bool lightPluginsAreSupported = gamePlugins ? gamePlugins->lightPluginsAreSupported() : false;
m_CurrentProfile = profileName;
@@ -265,8 +266,9 @@ void PluginList::refresh(const QString &profileName
// indices need to work. priority will be off however
updateIndices();
- GamePlugins *gamePlugins = m_GamePlugin->feature<GamePlugins>();
- gamePlugins->readPluginLists(this);
+ if (gamePlugins) {
+ gamePlugins->readPluginLists(this);
+ }
testMasters();
@@ -521,7 +523,9 @@ void PluginList::saveTo(const QString &lockedOrderFileName
, bool hideUnchecked) const
{
GamePlugins *gamePlugins = m_GamePlugin->feature<GamePlugins>();
- gamePlugins->writePluginLists(this);
+ if (gamePlugins) {
+ gamePlugins->writePluginLists(this);
+ }
writeLockedOrder(lockedOrderFileName);
@@ -870,7 +874,10 @@ void PluginList::generatePluginIndexes()
{
int numESLs = 0;
int numSkipped = 0;
- bool lightPluginsSupported = m_GamePlugin->feature<GamePlugins>()->lightPluginsAreSupported();
+
+ GamePlugins* gamePlugins = m_GamePlugin->feature<GamePlugins>();
+ const bool lightPluginsSupported = gamePlugins ? gamePlugins->lightPluginsAreSupported() : false;
+
for (int l = 0; l < m_ESPs.size(); ++l) {
int i = m_ESPsByPriority.at(l);
if (!m_ESPs[i].enabled) {