fix: ensure upstream branch exists before updating filter

This commit is contained in:
Gadfly 2025-05-13 17:57:54 +08:00
parent cf7b61dd71
commit 67b292ad86
No known key found for this signature in database

View file

@ -927,7 +927,11 @@ namespace SourceGit.ViewModels
return; return;
if (isLocal && !string.IsNullOrEmpty(branch.Upstream)) if (isLocal && !string.IsNullOrEmpty(branch.Upstream))
_settings.UpdateHistoriesFilter(branch.Upstream, Models.FilterType.RemoteBranch, mode); {
var upstreamNode = FindBranchNode(_remoteBranchTrees, branch.Upstream);
if (upstreamNode != null)
_settings.UpdateHistoriesFilter(branch.Upstream, Models.FilterType.RemoteBranch, mode);
}
} }
else else
{ {