Closed
Description
When deleting a repo-folder on disk, while SourceGit has that folder open in a tab/page, we'll get a crash in Repository.RefreshBranches()
, on this line: CurrentBranch = branches.Find(x => x.IsCurrent);
Repository.CurrentBranch.set
doesn't check (after calling SetProperty()
) if the NEW value of _currentBranch
is null, before trying to access its Head
property. Could be fixed by using _currentBranch?.Head
, but we should check that there are no follow-up errors due to there being no branches (and no repo) anymore.
NOTE: I found this crash when I removed a Worktree (from within SourceGit UI) while that Worktree was still open in another tab.