Skip to content

Commit

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

Signed-off-by: lixinguo <[email protected]>
Co-authored-by: lixinguo <[email protected]>
  • Loading branch information
smellthemoon and lixinguo authored Nov 3, 2024
1 parent 50de122 commit 51cb2fb
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 51cb2fb

Please sign in to comment.