diff --git a/processor/src/trace/utils.rs b/processor/src/trace/utils.rs index 5e3bb6b6d2..75e85cffba 100644 --- a/processor/src/trace/utils.rs +++ b/processor/src/trace/utils.rs @@ -31,7 +31,14 @@ impl<'a> TraceFragment<'a> { } /// Returns the number of rows in this execution trace fragment. + /// + /// Returns `0` if the fragment has no columns (i.e., `data` is empty). + /// Otherwise, returns the length of the first column, which should be the same + /// as the length of all other columns. pub fn len(&self) -> usize { + if self.data.is_empty() { + return 0; + } self.data[0].len() }