Skip to content

Commit 9f20a61

Browse files
committed
Fixed a crash with paths containing trailing spaces.
Directory.Exists removes trailing spaces before checking the folder, but the FileSystemWatched does not.
1 parent 798d2fc commit 9f20a61

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Logic/RepositoryWatcher.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.IO;
@@ -62,7 +62,7 @@ public RepositoryWatcher(string path, Boolean isBare)
6262

6363
public void Dispose()
6464
{
65-
_watcher.Dispose();
65+
_watcher?.Dispose();
6666
}
6767

6868
~RepositoryWatcher()

Logic/ViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public string RepositoryPath
3434
get { return _repositoryPath; }
3535
set
3636
{
37-
_repositoryPath = value;
37+
_repositoryPath = value.TrimEnd();
3838
if (IsValidGitRepository(_repositoryPath))
3939
{
4040
OnPropertyChanged("WindowTitle");

0 commit comments

Comments
 (0)