Skip to content

fix: crash when pressing “w” to watch checks#725

Merged
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:watchChecks-fix
Jan 1, 2026
Merged

fix: crash when pressing “w” to watch checks#725
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:watchChecks-fix

Conversation

@sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Jan 1, 2026

Summary

This change fixes a case where the watchChecks function was creating an empty prrow.Data{} struct, and calling GetStatusChecksRollup() on it – which led to a nil-pointer dereference when accessing pr.Data.Primary.Commits.Nodes.

The change fixes that by not doing the empty-prrow.Data{}-struct thing — and instead, switching to using the actual PR data from the current row. It also adds a nil check to GetStatusChecksRollup(), for further safety.

Fixes #718

How did you test this change?

Added unit tests for GetStatusChecksRollup().

This change fixes a case where the watchChecks function was creating an
empty prrow.Data{} struct, and calling GetStatusChecksRollup() on it – which
led to a nil-pointer dereference when accessing pr.Data.Primary.Commits.Nodes.

The change fixes that by not using an empty prrow.Data{} struct — and instead,
switching to using the actual PR data from the current row. It also adds a nil
check to GetStatusChecksRollup(), for further safety.

Fixes dlvhdr#718
Copy link
Owner

@dlvhdr dlvhdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing, thanks for the help!

@dlvhdr dlvhdr merged commit 1bfe70f into dlvhdr:main Jan 1, 2026
3 checks passed
@sideshowbarker sideshowbarker deleted the watchChecks-fix branch January 1, 2026 20:43
@sideshowbarker
Copy link
Contributor Author

amazing, thanks for the help!

Continued thanks for creating & maintaining (and ongoing refining) of such a great app, that’s a genuine delight to hack on~

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.

[BUG] Crash when pressing 'w' to focus preview pane on section with external repos

2 participants