Skip to content

fix: multiple crash-inducing bugs and resource leaks#732

Merged
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:crash-fixes
Jan 6, 2026
Merged

fix: multiple crash-inducing bugs and resource leaks#732
dlvhdr merged 1 commit intodlvhdr:mainfrom
sideshowbarker:crash-fixes

Conversation

@sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Jan 5, 2026

Summary

  • BranchData.GetUpdatedAt(): add nil check for LastUpdatedAt pointer
  • BranchData.GetRepoNameWithOwner(): add empty check for Remotes slice
  • reposection/prssection/issuessection GetCurrRow(): validate GetCurrItem()
    index is within bounds before accessing slice
  • cmd/root.go: fix file handle leak by assigning opened file to loggerFile
    so it gets returned and closed by caller
  • watchChecks.go: use captured values instead of calling GetCurrRow() again
    inside goroutine (race condition)
  • prapi.go: reuse cachedClient instead of creating new GraphQL client on
    every FetchPullRequest call (resource waste + variable shadowing)
  • markdownRenderer.go: handle error from glamour.NewTermRenderer with
    fallback renderer instead of dereferencing nil pointer

How did you test this change?

Added internal/tui/components/branch/data_test.go

- BranchData.GetUpdatedAt(): add nil check for LastUpdatedAt pointer
- BranchData.GetRepoNameWithOwner(): add empty check for Remotes slice
- reposection/prssection/issuessection GetCurrRow(): validate GetCurrItem()
  index is within bounds before accessing slice
- cmd/root.go: fix file handle leak by assigning opened file to loggerFile
  so it gets returned and closed by caller
- watchChecks.go: use captured values instead of calling GetCurrRow() again
  inside goroutine (race condition)
- prapi.go: reuse cachedClient instead of creating new GraphQL client on
  every FetchPullRequest call (resource waste + variable shadowing)
- markdownRenderer.go: handle error from glamour.NewTermRenderer with
  fallback renderer instead of dereferencing nil pointer
@dlvhdr dlvhdr merged commit b513536 into dlvhdr:main Jan 6, 2026
3 checks passed
@sideshowbarker sideshowbarker deleted the crash-fixes 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