From b32069a926915f36f1b6e941da30c2c29c8e8164 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:36:01 +0900 Subject: [PATCH] fix: NullReferenceException thrown when running tests --- test/Docfx.Tests.Common/TestListenerScope.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Docfx.Tests.Common/TestListenerScope.cs b/test/Docfx.Tests.Common/TestListenerScope.cs index 9c9764168e8..9607a8c084c 100644 --- a/test/Docfx.Tests.Common/TestListenerScope.cs +++ b/test/Docfx.Tests.Common/TestListenerScope.cs @@ -24,7 +24,7 @@ public void Flush() { } public void WriteLine(ILogItem item) { if (item.LogLevel >= _logLevel) - s_items.Value.Add(item); + s_items.Value?.Add(item); } public IEnumerable GetItemsByLogLevel(LogLevel logLevel)