Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 835ebb1

Browse files
committed
Fix CreateLocalRepositoryModel when no repository
1 parent 023f693 commit 835ebb1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/GitHub.Exports/Services/GitService.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ public LocalRepositoryModel CreateLocalRepositoryModel(string localPath)
4141

4242
using (var repository = GetRepository(localPath))
4343
{
44-
var cloneUrl = GetUri(repository);
45-
var noRemoteOrigin = HasNoRemoteOrigin(repository);
44+
UriString cloneUrl = null;
45+
bool noRemoteOrigin = false;
46+
if (repository != null)
47+
{
48+
cloneUrl = GetUri(repository);
49+
noRemoteOrigin = HasNoRemoteOrigin(repository);
50+
}
51+
4652
var name = cloneUrl?.RepositoryName ?? dir.Name;
4753

4854
var model = new LocalRepositoryModel

0 commit comments

Comments
 (0)