Fix crash due to missing name in file system changed event when running git command background without SourceGit

This commit is contained in:
leo 2020-07-15 15:35:49 +08:00
parent 863e83d402
commit a82943d649

View file

@ -361,6 +361,8 @@ namespace SourceGit.Git {
} }
private void OnFSChanged(object sender, FileSystemEventArgs e) { private void OnFSChanged(object sender, FileSystemEventArgs e) {
if (string.IsNullOrEmpty(e.Name)) return;
if (e.Name.StartsWith(".git", StringComparison.Ordinal)) { if (e.Name.StartsWith(".git", StringComparison.Ordinal)) {
if (e.Name.Equals(".git") || e.Name.StartsWith(".git\\index")) return; if (e.Name.Equals(".git") || e.Name.StartsWith(".git\\index")) return;