Skip to content

Commit 62db5de

Browse files
committed
Add null check to ReferenceCollection
1 parent bdf4a61 commit 62db5de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/GitVersion.LibGit2Sharp/Git/ReferenceCollection.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
using GitVersion.Extensions;
2+
13
namespace GitVersion;
24

35
internal sealed class ReferenceCollection : IReferenceCollection
46
{
57
private readonly LibGit2Sharp.ReferenceCollection innerCollection;
6-
internal ReferenceCollection(LibGit2Sharp.ReferenceCollection collection) => this.innerCollection = collection;
8+
9+
internal ReferenceCollection(LibGit2Sharp.ReferenceCollection collection)
10+
=> this.innerCollection = collection.NotNull();
711

812
public IEnumerator<IReference> GetEnumerator() => this.innerCollection.Select(reference => new Reference(reference)).GetEnumerator();
913

0 commit comments

Comments
 (0)