Skip to content

Commit 9471641

Browse files
committed
Fix issue with jsonpointer remove
1 parent b3d535b commit 9471641

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/jsoncons_ext/jsonpointer/jsonpointer.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,11 @@ namespace jsonpointer {
938938
template <typename Json>
939939
void remove(Json& root, const basic_json_pointer<typename Json::char_type>& location, std::error_code& ec)
940940
{
941+
if (location.empty())
942+
{
943+
return;
944+
}
945+
941946
Json* current = std::addressof(root);
942947

943948
std::basic_string<typename Json::char_type> buffer;

0 commit comments

Comments
 (0)