Skip to content

Commit

Permalink
Merge pull request #72 from paulsengroup/bugfix
Browse files Browse the repository at this point in the history
Fix segfault
  • Loading branch information
robomics authored Oct 1, 2023
2 parents dc02eb7 + df827a6 commit c3cc077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ inline MultiResFile::operator bool() const noexcept { return !!_root_grp; }
inline std::string MultiResFile::path() const { return (*_root_grp)().getFile().getName(); }

inline auto MultiResFile::chromosomes() const noexcept -> const Reference& {
return open(_resolutions.back()).chromosomes();
return _chroms;
}

[[nodiscard]] inline std::uint32_t MultiResFile::compute_base_resolution(
Expand Down
2 changes: 2 additions & 0 deletions test/units/cooler/multires_cooler_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ TEST_CASE("MultiResCooler: open read-only", "[cooler][short]") {

auto mclr = MultiResFile(path.string());

CHECK(mclr.chromosomes().size() == 20);
CHECK(mclr.chromosomes().begin()->name() == "1");
CHECK(mclr.resolutions().size() == 7);
CHECK(mclr.attributes().format == MCOOL_MAGIC);
CHECK(mclr.attributes().format_version == 2);
Expand Down

0 comments on commit c3cc077

Please sign in to comment.