diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2012-04-14 20:09:33 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-04-15 14:38:55 +0400 |
commit | 157ee6f29cd255bba847f1cc4b2364da23c4c8e7 (patch) | |
tree | eed27b4f890261014e42b9ad91c0852e5e39085e /LibGit2Sharp | |
parent | 1b00c6833b690897ea3572ec9e210394cd6e43be (diff) |
Throw when accessing Index of a bare repository
Diffstat (limited to 'LibGit2Sharp')
-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> |