Skip to content

Commit 636a20e

Browse files
committed
Helper: Fixed NullOrEmptyCheck from throwing every time
1 parent 53a0360 commit 636a20e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Helper/Helper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ public static T Call<T>(this T item, Action<T> action)
14461446
#else
14471447
public
14481448
#endif
1449-
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.");
1449+
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.");
14501450

14511451
#if !LITE
14521452
/// <summary>

0 commit comments

Comments
 (0)