mirror of https://github.com/milvus-io/milvus.git
fix: parse fail in empty json (#37294)
#37200 Signed-off-by: lixinguo <xinguo.li@zilliz.com> Co-authored-by: lixinguo <xinguo.li@zilliz.com>pull/37215/head
parent
50de122dc7
commit
51cb2fbf97
|
@ -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,
|
||||
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue