Bug-fix: Prevent exception on repo with no commits/branches

This commit is contained in:
Göran W 2025-06-03 22:20:04 +02:00
parent fa30faeb6d
commit 76fe5805e5

View file

@ -1120,7 +1120,8 @@ namespace SourceGit.ViewModels
if (_workingCopy != null)
_workingCopy.HasRemotes = remotes.Count > 0;
GetOwnerPage()?.ChangeDirtyState(Models.DirtyState.HasPendingPullOrPush, !CurrentBranch.TrackStatus.IsVisible);
var hasPendingPullOrPush = CurrentBranch?.TrackStatus.IsVisible ?? false;
GetOwnerPage()?.ChangeDirtyState(Models.DirtyState.HasPendingPullOrPush, !hasPendingPullOrPush);
});
}