Fix: make CConfigure::GetBoolean safe against missing keys

pull/23/head
Dave Behnke 1 month ago
parent 986f7c9641
commit 6781b692d1

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

Loading…
Cancel
Save

Powered by TurnKey Linux.