Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parse fail in empty json #37294

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

value_result<document>
doc() const {
if (data_.size() == 0) {
return {};

Check warning on line 137 in internal/core/src/common/Json.h

View check run for this annotation

Codecov / codecov/patch

internal/core/src/common/Json.h#L137

Added line #L137 was not covered by tests
}
thread_local simdjson::ondemand::parser parser;

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

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

Check warning on line 155 in internal/core/src/common/Json.h

View check run for this annotation

Codecov / codecov/patch

internal/core/src/common/Json.h#L155

Added line #L155 was not covered by tests
}
thread_local simdjson::dom::parser parser;

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