Skip to content

Fix PhyDatToMatrix crash on zero-character phyDat#261

Merged
ms609 merged 1 commit intomainfrom
fix/zero-char-phydat
Mar 17, 2026
Merged

Fix PhyDatToMatrix crash on zero-character phyDat#261
ms609 merged 1 commit intomainfrom
fix/zero-char-phydat

Conversation

@ms609
Copy link
Copy Markdown
Owner

@ms609 ms609 commented Mar 17, 2026

PhyDatToMatrix() crashed when given a phyDat with nr=0 (e.g. from a star tree) because matrix() could not reconcile empty data with non-empty dimnames. Add an early return for the nr=0 case, returning a 0-column matrix with correct row names.

This also fixes AddUnconstrained() when passed such a phyDat, since it delegates to PhyDatToMatrix() internally.

PhyDatToMatrix() crashed when given a phyDat with nr=0 (e.g. from a
star tree) because matrix() could not reconcile empty data with
non-empty dimnames. Add an early return for the nr=0 case, returning
a 0-column matrix with correct row names.

This also fixes AddUnconstrained() when passed such a phyDat, since
it delegates to PhyDatToMatrix() internally.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.36%. Comparing base (5bb40b8) to head (fe21dfc).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #261   +/-   ##
=======================================
  Coverage   96.36%   96.36%           
=======================================
  Files          78       78           
  Lines        5774     5777    +3     
=======================================
+ Hits         5564     5567    +3     
  Misses        210      210           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Repository owner deleted a comment from github-actions bot Mar 17, 2026
@ms609 ms609 merged commit 0b9b80f into main Mar 17, 2026
36 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant