Skip to content

Commit abe237e

Browse files
Initialize json value to nullptr in constructor for json_type::object
1 parent 20c4319 commit abe237e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/json.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ namespace json
4242
*
4343
* @param type The type of the JSON object to be constructed.
4444
*/
45-
json(json_type type = json_type::object) noexcept
45+
json(json_type type = json_type::object) noexcept : value(nullptr)
4646
{
4747
switch (type)
4848
{
4949
case json_type::null:
50-
value = nullptr;
5150
break;
5251
case json_type::boolean:
5352
value = false;

0 commit comments

Comments
 (0)