Update StaticFilterOptionsMonitor.cs (#80959)
authorqsdfplkj <35060463+qsdfplkj@users.noreply.github.com>
Sun, 22 Jan 2023 22:25:09 +0000 (23:25 +0100)
committerGitHub <noreply@github.com>
Sun, 22 Jan 2023 22:25:09 +0000 (14:25 -0800)
Fixes https://github.com/dotnet/runtime/issues/80902

src/libraries/Microsoft.Extensions.Logging/src/StaticFilterOptionsMonitor.cs

index 57f17d5..312bb60 100644 (file)
@@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Logging
     {
         public StaticFilterOptionsMonitor(LoggerFilterOptions currentValue)
         {
-            CurrentValue = currentValue;
+            CurrentValue = currentValue ?? throw new ArgumentNullException(nameof(currentValue));
         }
 
         public IDisposable? OnChange(Action<LoggerFilterOptions, string> listener) => null;