🐛 add missing negation

parent edd24629
...@@ -20313,7 +20313,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -20313,7 +20313,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
reference at(const KeyType& key) reference at(const KeyType& key)
{ {
// at only works for objects // at only works for objects
if (JSON_HEDLEY_UNLIKELY(is_object())) if (JSON_HEDLEY_UNLIKELY(!is_object()))
{ {
JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()), *this)); JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()), *this));
} }
...@@ -20364,7 +20364,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -20364,7 +20364,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
const_reference at(const KeyType& key) const const_reference at(const KeyType& key) const
{ {
// at only works for objects // at only works for objects
if (JSON_HEDLEY_UNLIKELY(is_object())) if (JSON_HEDLEY_UNLIKELY(!is_object()))
{ {
JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()), *this)); JSON_THROW(type_error::create(304, "cannot use at() with " + std::string(type_name()), *this));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment