diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cam/options.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 77b3cc1f..358507ea 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -61,7 +61,12 @@ bool OptionsBase<T>::isSet(const T &opt) const template<typename T> const OptionValue &OptionsBase<T>::operator[](const T &opt) const { - return values_.find(opt)->second; + static const OptionValue empty; + + auto it = values_.find(opt); + if (it != values_.end()) + return it->second; + return empty; } template<typename T> |