summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcamera/controls.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 85a56e62..7920abba 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -375,11 +375,12 @@ public:
template<typename T>
std::optional<T> get(const Control<T> &ctrl) const
{
- const ControlValue *val = find(ctrl.id());
- if (!val)
+ const auto entry = controls_.find(ctrl.id());
+ if (entry == controls_.end())
return std::nullopt;
- return val->get<T>();
+ const ControlValue &val = entry->second;
+ return val.get<T>();
}
template<typename T, typename V>