diff options
| author | Philip Damianik <39028343+pdamianik@users.noreply.github.com> | 2023-09-06 19:16:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-06 19:16:46 +0200 |
| commit | 60c01dab01e3b58abf12c49f4a2fb224900ae401 (patch) | |
| tree | c29dd3ff1288e14e2fc592d2f2541f92f1e9f1b0 /src/config/ConfigManager.cpp | |
| parent | a15e3e1f380e3b90f976bc7d1d8b4daabd4cbd3b (diff) | |
config: Integrate HASCONFIG into CConfigManager::getConfigValueSafeDevice (#3195)
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 0865eae6..01b099f7 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -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]; } |
