From 4076a3b6d7930ea30799f180fec2f13e1819f3d7 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 28 Jul 2022 21:38:30 +0200 Subject: fixed device configs --- src/config/ConfigManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/config/ConfigManager.cpp') 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; } } -- cgit v1.2.3