summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp6
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;
}
}