diff options
Diffstat (limited to 'LibGit2Sharp/Repository.cs')
-rw-r--r-- | LibGit2Sharp/Repository.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs index 2593bcb3..680d9670 100644 --- a/LibGit2Sharp/Repository.cs +++ b/LibGit2Sharp/Repository.cs @@ -101,7 +101,15 @@ namespace LibGit2Sharp /// </summary> public Index Index { - get { return index; } + get + { + if (index == null) + { + throw new LibGit2Exception("Index is not available in a bare repository."); + } + + return index; + } } /// <summary> |