config: Integrate HASCONFIG into CConfigManager::getConfigValueSafeDevice (#3195)

This commit is contained in:
Philip Damianik 2023-09-06 19:16:46 +02:00 committed by GitHub
parent a15e3e1f38
commit 60c01dab01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 54 deletions

View file

@ -1691,13 +1691,15 @@ SConfigValue CConfigManager::getConfigValueSafeDevice(const std::string& dev, co
const auto it = deviceConfigs.find(dev);
if (it == deviceConfigs.end()) {
Debug::log(ERR, "getConfigValueSafeDevice: No device config for {} found???", dev.c_str());
return SConfigValue();
if (fallback.empty()) {
Debug::log(ERR, "getConfigValueSafeDevice: No device config for {} found???", dev.c_str());
return SConfigValue();
}
return configValues[fallback];
}
const SConfigValue DEVICECONFIG = it->second[val];
// fallback if not set explicitly
if (!DEVICECONFIG.set && !fallback.empty()) {
return configValues[fallback];
}