Skip to content

Commit

Permalink
Fix error on file save
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed May 1, 2023
1 parent 4dbd0af commit 3cca7f2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/re_log_types/src/data_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,15 @@ impl DataTable {
let mut columns = Vec::new();

for (component, rows) in table {
let (field, column) = Self::serialize_data_column(component.as_str(), rows)?;
schema.fields.push(field);
columns.push(column);
// If none of the rows have any data, there's nothing to do here
// TODO(jleibs): would be nice to make serialize_data_column robust to this case
// but I'm not sure if returning an empty column is the right thing to do there.
// See: https://github.com/rerun-io/rerun/issues/2005
if rows.iter().any(|c| c.is_some()) {
let (field, column) = Self::serialize_data_column(component.as_str(), rows)?;
schema.fields.push(field);
columns.push(column);
}
}

Ok((schema, columns))
Expand Down

0 comments on commit 3cca7f2

Please sign in to comment.