config/legacy: fix crash on getConfigValue of plugin fns

This commit is contained in:
Vaxry 2026-05-04 16:17:48 +01:00
parent 33044c3816
commit 2824ffdda0
No known key found for this signature in database

View file

@ -1155,6 +1155,15 @@ std::string CConfigManager::getDeviceString(const std::string& dev, const std::s
}
SConfigOptionReply CConfigManager::getConfigValue(const std::string& val) {
if (val.starts_with("plugin:")) {
const auto VAL = m_config->getSpecialConfigValuePtr("plugin", val.substr(7).c_str(), nullptr);
if (!VAL)
return {};
return {.dataptr = VAL->getDataStaticPtr(), .type = &VAL->getValue().type(), .setByUser = VAL->m_bSetByUser};
}
const auto VAL = m_config->getConfigValuePtr(val.c_str());
if (!VAL)
return {};