Skip to content

Commit c6fefe1

Browse files
committed
Add null check to TagCollection
1 parent 03b29d1 commit c6fefe1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
using GitVersion.Extensions;
2+
13
namespace GitVersion;
24

35
internal sealed class TagCollection : ITagCollection
46
{
57
private readonly LibGit2Sharp.TagCollection innerCollection;
6-
internal TagCollection(LibGit2Sharp.TagCollection collection) => this.innerCollection = collection;
78

8-
public IEnumerator<ITag> GetEnumerator() => this.innerCollection.Select(tag => new Tag(tag)).GetEnumerator();
9+
internal TagCollection(LibGit2Sharp.TagCollection collection)
10+
=> this.innerCollection = collection.NotNull();
11+
12+
public IEnumerator<ITag> GetEnumerator()
13+
=> this.innerCollection.Select(tag => new Tag(tag)).GetEnumerator();
914

1015
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
1116
}

0 commit comments

Comments
 (0)