Skip to content

Commit

Permalink
fix: parse fail in empty json(#37294) (#37295)
Browse files Browse the repository at this point in the history
pr: #37294 
issue: #37200

Signed-off-by: lixinguo <[email protected]>
Co-authored-by: lixinguo <[email protected]>
  • Loading branch information
smellthemoon and lixinguo authored Nov 1, 2024
1 parent 5aee184 commit e714e42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/core/src/common/Json.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class Json {

value_result<document>
doc() const {
if (data_.size() == 0) {
return {};
}
thread_local simdjson::ondemand::parser parser;

// it's always safe to add the padding,
Expand All @@ -148,6 +151,9 @@ class Json {

value_result<simdjson::dom::element>
dom_doc() const {
if (data_.size() == 0) {
return {};
}
thread_local simdjson::dom::parser parser;

// it's always safe to add the padding,
Expand Down

0 comments on commit e714e42

Please sign in to comment.