fix: panic when result is empty (#26)

This commit is contained in:
Hengfei Yang
2023-02-07 09:56:41 +05:30
committed by GitHub
parent ad7743a6c3
commit eff2bf0c24
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap;
use segment::{message::Track, Client, Message};
use serde_json::Value;
use std::collections::HashMap;
use crate::infra::config::{CONFIG, INSTANCE_ID, STREAM_SCHEMAS, TELEMETRY_CLIENT, USERS, VERSION};
+1 -1
View File
@@ -148,7 +148,7 @@ pub async fn search(
Some(batches) => batches.to_owned(),
None => Vec::new(),
};
if !result_query.is_empty() {
if !result_query.is_empty() && !result_query[0].is_empty() {
let schema = result_query[0][0].schema();
let ipc_options = ipc::writer::IpcWriteOptions::default();
let ipc_options = ipc_options