handle empty variants returned from pluginSetting()

can happen when init() is called when MO has no instance set up
This commit is contained in:
isanae
2020-11-04 22:52:56 -05:00
parent 83dec58e4a
commit 6445f7f47f
+3 -1
View File
@@ -116,7 +116,9 @@ typedef IPythonRunner* (*CreatePythonRunner_func)(const MOBase::IOrganizer *moIn
bool ProxyPython::init(IOrganizer *moInfo)
{
m_MOInfo = moInfo;
if (!m_MOInfo->pluginSetting(name(), "enabled").toBool()) {
const auto enabled = m_MOInfo->pluginSetting(name(), "enabled");
if (!enabled.isNull() && !enabled.toBool()) {
m_LoadFailure = FAIL_NONE;
return false;
}