Skip to content

fix: crash when switching to RepoView before data is loaded#731

Merged
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:RepoView-crash-fix
Jan 7, 2026
Merged

fix: crash when switching to RepoView before data is loaded#731
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:RepoView-crash-fix

Conversation

@sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Jan 5, 2026

Summary

When m.repo hasn't been initialized yet, return an empty slice – rather than a slice containing nil. That prevents a nil-pointer dereference when calling GetId() on the section – which in turn prevents dash from crashing on you when you try to switch into the Branch/Repo view.

How did you test this change?

Added a TestGetCurrentViewSections_RepoViewWithNilRepo test in internal/tui/ui_test.go

When m.repo hasn't been initialized yet, return an empty slice – rather
than a slice containing nil. That prevents a nil-pointer dereference
when calling GetId() on the section – which in turn prevents dash from
crashing on you when you try to switch into the Branch/Repo view.
@dlvhdr dlvhdr merged commit 9513616 into dlvhdr:main Jan 7, 2026
3 checks passed
@sideshowbarker sideshowbarker deleted the RepoView-crash-fix branch February 7, 2026 07:32
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.

2 participants