diff options
Diffstat (limited to 'Source/Core/Common/Config/Layer.cpp')
| -rw-r--r-- | Source/Core/Common/Config/Layer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/Common/Config/Layer.cpp b/Source/Core/Common/Config/Layer.cpp index 0e201001be..573c79c04e 100644 --- a/Source/Core/Common/Config/Layer.cpp +++ b/Source/Core/Common/Config/Layer.cpp @@ -46,8 +46,14 @@ bool Layer::Exists(const ConfigLocation& location) const bool Layer::DeleteKey(const ConfigLocation& location) { m_is_dirty = true; - bool had_value = m_map[location].has_value(); - m_map[location].reset(); + bool had_value = false; + const auto iter = m_map.find(location); + if (iter != m_map.end() && iter->second.has_value()) + { + iter->second.reset(); + had_value = true; + } + return had_value; } |
