Skip to content

Commit 2e77635

Browse files
committed
graphql: handle empty lists in list_values to avoid panic
1 parent 2252f6d commit 2e77635

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graphql/src/store/query.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ fn build_child_filter_from_object(
417417
fn list_values(value: Value, filter_type: &str) -> Result<Vec<Value>, QueryExecutionError> {
418418
match value {
419419
Value::List(values) => {
420+
if values.is_empty() {
421+
return Ok(values);
422+
}
420423
// Check that all values in list are of the same type
421424
let root_discriminant = discriminant(&values[0]);
422425
for value in &values {

0 commit comments

Comments
 (0)