Skip to content

Commit acb240f

Browse files
committed
Add null check to RefSpecCollection
1 parent e2bac71 commit acb240f

File tree

1 file changed

+6
-1
lines changed

1 file changed

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

35
internal sealed class RefSpecCollection : IRefSpecCollection
46
{
57
private readonly LibGit2Sharp.RefSpecCollection innerCollection;
6-
internal RefSpecCollection(LibGit2Sharp.RefSpecCollection collection) => this.innerCollection = collection;
8+
9+
internal RefSpecCollection(LibGit2Sharp.RefSpecCollection collection)
10+
=> this.innerCollection = collection.NotNull();
11+
712
public IEnumerator<IRefSpec> GetEnumerator() => this.innerCollection.Select(tag => new RefSpec(tag)).GetEnumerator();
813
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
914
}

0 commit comments

Comments
 (0)