diff --git a/src/FilterLists.Agent/Extensions/ReadOnlyListExtensions.cs b/src/FilterLists.Agent/Extensions/ReadOnlyListExtensions.cs index 093fc24fc..101ca01b0 100644 --- a/src/FilterLists.Agent/Extensions/ReadOnlyListExtensions.cs +++ b/src/FilterLists.Agent/Extensions/ReadOnlyListExtensions.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace FilterLists.Agent.Extensions { @@ -6,9 +7,9 @@ public static class ReadOnlyListExtensions { public static T FirstOrDefault(this IReadOnlyList list) { - if (list is null || list.Count == 0) - return default; - return list[0]; + if (list is null) + throw new ArgumentNullException(nameof(list)); + return list.Count == 0 ? default : list[0]; } } } \ No newline at end of file