Skip to content

Commit dde05f6

Browse files
authored
Fix: Fixed crash that would occur when Git path contained an emoji (#14643)
1 parent 71a8cd8 commit dde05f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Files.App/Utils/Git/GitHelpers.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Net.Http;
1010
using System.Net.Http.Json;
1111
using System.Net.Sockets;
12+
using System.Text;
1213
using System.Text.Json;
1314
using System.Text.RegularExpressions;
1415

@@ -96,7 +97,7 @@ public static void TryDispose()
9697
? path
9798
: GetGitRepositoryPath(PathNormalization.GetParentDir(path), root);
9899
}
99-
catch (LibGit2SharpException ex)
100+
catch (Exception ex) when (ex is LibGit2SharpException or EncoderFallbackException)
100101
{
101102
_logger.LogWarning(ex.Message);
102103

0 commit comments

Comments
 (0)