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

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

No files matched your search

@@ -50,7 +50,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;