diff --git a/src/DotNetCore.CAP/Diagnostics/TracingHeaders.cs b/src/DotNetCore.CAP/Diagnostics/TracingHeaders.cs index 11093d4..8fb7e21 100644 --- a/src/DotNetCore.CAP/Diagnostics/TracingHeaders.cs +++ b/src/DotNetCore.CAP/Diagnostics/TracingHeaders.cs @@ -9,7 +9,7 @@ namespace DotNetCore.CAP.Diagnostics { public class TracingHeaders : IEnumerable> { - private List> _dataStore; + private List> _dataStore = new List>(); public IEnumerator> GetEnumerator() { @@ -23,11 +23,6 @@ namespace DotNetCore.CAP.Diagnostics public void Add(string name, string value) { - if (_dataStore == null) - { - _dataStore = new List>(); - } - _dataStore.Add(new KeyValuePair(name, value)); } @@ -46,4 +41,4 @@ namespace DotNetCore.CAP.Diagnostics _dataStore?.Clear(); } } -} \ No newline at end of file +}