mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
json: write null on abnormal placeholder destruction
Avoids leaving dangling attributes like { "foo": } in case of exceptions.
This commit is contained in:
parent
7aa36ae796
commit
8188b1d0ab
1 changed files with 5 additions and 1 deletions
|
@ -193,7 +193,11 @@ JSONObject JSONPlaceholder::object()
|
|||
|
||||
JSONPlaceholder::~JSONPlaceholder()
|
||||
{
|
||||
assert(!first || std::uncaught_exceptions());
|
||||
if (first) {
|
||||
assert(std::uncaught_exceptions());
|
||||
if (state->stack != 0)
|
||||
write(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue