Skip to content

Commit

Permalink
Fix for failing unit tests
Browse files Browse the repository at this point in the history
- Check for `storage_` is not nullptr since it could be called from
destructor
- Add `storage_->update_metadata(metadata_)` in
`SequentialCompressionWriter::close()`

Signed-off-by: Michael Orlov <[email protected]>
  • Loading branch information
morlov-apexai committed Nov 6, 2022
1 parent 77662e5 commit 294db35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ void SequentialCompressionWriter::close()
stop_compressor_threads();

finalize_metadata();
if (storage_) {
storage_->update_metadata(metadata_);
}
metadata_io_->write_metadata(base_folder_, metadata_);
}

Expand Down
4 changes: 3 additions & 1 deletion rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ void SequentialWriter::close()

if (!base_folder_.empty()) {
finalize_metadata();
storage_->update_metadata(metadata_);
if (storage_) {
storage_->update_metadata(metadata_);
}
metadata_io_->write_metadata(base_folder_, metadata_);
}

Expand Down

0 comments on commit 294db35

Please sign in to comment.