diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 5e44e8d70..fefc750fd 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -400,7 +400,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec }; std::unique_ptr obj(AllocatorTraits::allocate(alloc, 1), deleter); AllocatorTraits::construct(alloc, obj.get(), std::forward(args)...); - JSON_ASSERT(obj != nullptr); + JSON_ASSERT(obj); return obj.release(); } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 07366543e..0e23b09a6 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -20918,7 +20918,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec }; std::unique_ptr obj(AllocatorTraits::allocate(alloc, 1), deleter); AllocatorTraits::construct(alloc, obj.get(), std::forward(args)...); - JSON_ASSERT(obj != nullptr); + JSON_ASSERT(obj); return obj.release(); }