From d2c219194ce68890feb8e596e2b4e2f35c931f77 Mon Sep 17 00:00:00 2001 From: tanchekwei Date: Thu, 15 Jun 2023 20:53:35 +0800 Subject: [PATCH] Fix crash when branch tip is null --- src/Files.App/Helpers/GitHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Helpers/GitHelpers.cs b/src/Files.App/Helpers/GitHelpers.cs index e28dbcac2dca..dd0501ef6c06 100644 --- a/src/Files.App/Helpers/GitHelpers.cs +++ b/src/Files.App/Helpers/GitHelpers.cs @@ -83,7 +83,7 @@ public static BranchItem[] GetBranchesNames(string? path) .Where(b => !b.IsRemote || b.RemoteName == "origin") .OrderByDescending(b => b.IsCurrentRepositoryHead) .ThenBy(b => b.IsRemote) - .ThenByDescending(b => b.Tip.Committer.When) + .ThenByDescending(b => b.Tip?.Committer.When) .Select(b => new BranchItem(b.FriendlyName, b.IsRemote, b.TrackingDetails.AheadBy, b.TrackingDetails.BehindBy)) .ToArray(); }