diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-28 21:38:30 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-28 21:38:30 +0200 |
| commit | 4076a3b6d7930ea30799f180fec2f13e1819f3d7 (patch) | |
| tree | 1f732f41e544c0addf2686850dba1b89332a33eb /src/config/ConfigManager.cpp | |
| parent | 13d9c85e4e6f574b644f510ce803c0b0c8472b62 (diff) | |
fixed device configs
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 3b5fce8f..d34fbb29 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1105,7 +1105,11 @@ SConfigValue CConfigManager::getConfigValueSafeDevice(const std::string& dev, co // fallback if not set explicitly if (!copy.set) { for (auto& cv : configValues) { - if (cv.first.find(val) == cv.first.length() - val.length()) { + auto foundIt = cv.first.find(val); + if (foundIt == std::string::npos) + continue; + + if (foundIt == cv.first.length() - val.length()) { copy = cv.second; } } |
