From 55f5f2b85e978a46fce5e52ec87bc465aecdf3fb Mon Sep 17 00:00:00 2001 From: Bruce Tian Date: Tue, 12 Aug 2025 21:54:18 +0800 Subject: [PATCH] fix: avoid using disposed originalState --- src/ZLogger/LogStates/StringFormatterLogState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZLogger/LogStates/StringFormatterLogState.cs b/src/ZLogger/LogStates/StringFormatterLogState.cs index 84cab56..13690d7 100644 --- a/src/ZLogger/LogStates/StringFormatterLogState.cs +++ b/src/ZLogger/LogStates/StringFormatterLogState.cs @@ -25,7 +25,7 @@ public StringFormatterLogState(TState originalState, Exception? exception, Func< if (originalState is IReadOnlyList> x) { - originalStateParameters = x; + originalStateParameters = new List>(x); if (x.Count != 0 && x[^1].Key == "{OriginalFormat}") { ParameterCount = x.Count - 1;