Skip to content

Commit

Permalink
Helper: Fixed NullOrEmptyCheck from throwing every time
Browse files Browse the repository at this point in the history
  • Loading branch information
Emik03 committed Oct 13, 2021
1 parent 53a0360 commit 636a20e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Helper/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ public static T Call<T>(this T item, Action<T> action)
#else
public
#endif
static T NullOrEmptyCheck<T>(this T source, string message = null) where T : IEnumerable => source.Assert(nameof(source), message ?? "not null").GetEnumerator().MoveNext() ? source : throw new EmptyIteratorException(message ?? $"While asserting for null or empty, the variable ended up being empty.");
static T NullOrEmptyCheck<T>(this T source, string message = null) where T : IEnumerable => source.Assert(t => t is { }, nameof(source), message ?? "not null").GetEnumerator().MoveNext() ? source : throw new EmptyIteratorException(message ?? $"While asserting for null or empty, the variable ended up being empty.");

#if !LITE
/// <summary>
Expand Down

0 comments on commit 636a20e

Please sign in to comment.