1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

Add assertion if nullptr is passed to parse function (#3593)

Addresses #3584
This commit is contained in:
Niels Lohmann
2022-07-23 01:26:51 +02:00
committed by GitHub
parent b185c5bc9d
commit dbfd33a70a
5 changed files with 52 additions and 4 deletions

View File

@ -5936,7 +5936,9 @@ class file_input_adapter
JSON_HEDLEY_NON_NULL(2)
explicit file_input_adapter(std::FILE* f) noexcept
: m_file(f)
{}
{
JSON_ASSERT(m_file != nullptr);
}
// make class move-only
file_input_adapter(const file_input_adapter&) = delete;