moves the comment to a more appropriate position, nullifies the root if referenced in erase
This commit is contained in:
parent
44166ff4d6
commit
e66a3e5242
@ -409,15 +409,17 @@ class json_pointer
|
||||
// if we get here, it means that no exception was thrown, so therefore the value specified to
|
||||
// erase exists
|
||||
|
||||
// if previous exists, it means that the specified json value was not a root, so, we use the previous
|
||||
// object and erase from it
|
||||
if (previous)
|
||||
{
|
||||
// if previous exists, it means that the specified json value was not a root, so, we use the previous
|
||||
// object and erase from it
|
||||
previous->erase(reference_tokens.back());
|
||||
}
|
||||
else
|
||||
{
|
||||
// what to do
|
||||
// else it means the root was referenced, so we nullify it.
|
||||
if (ptr != nullptr)
|
||||
*ptr = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user