Fix: make CConfigure::GetBoolean safe against missing keys

pull/21/head
Dave Behnke 1 month ago
parent 8fa442b0b9
commit 38a3602323

@ -978,8 +978,8 @@ unsigned CConfigure::GetUnsigned(const std::string &key) const
bool CConfigure::GetBoolean(const std::string &key) const bool CConfigure::GetBoolean(const std::string &key) const
{ {
if (data[key].is_boolean()) if (data.contains(key) && data[key].is_boolean())
return data[key]; return data[key].get<bool>();
else else
return false; return false;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.