Commit e8931b32 authored by leisurelyclouds's avatar leisurelyclouds Committed by Savorboard

fix NullReferenceException (#335)

parent fbda6e2b
...@@ -9,7 +9,7 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -9,7 +9,7 @@ namespace DotNetCore.CAP.Diagnostics
{ {
public class TracingHeaders : IEnumerable<KeyValuePair<string, string>> public class TracingHeaders : IEnumerable<KeyValuePair<string, string>>
{ {
private List<KeyValuePair<string, string>> _dataStore; private List<KeyValuePair<string, string>> _dataStore = new List<KeyValuePair<string, string>>();
public IEnumerator<KeyValuePair<string, string>> GetEnumerator() public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{ {
...@@ -23,11 +23,6 @@ namespace DotNetCore.CAP.Diagnostics ...@@ -23,11 +23,6 @@ namespace DotNetCore.CAP.Diagnostics
public void Add(string name, string value) public void Add(string name, string value)
{ {
if (_dataStore == null)
{
_dataStore = new List<KeyValuePair<string, string>>();
}
_dataStore.Add(new KeyValuePair<string, string>(name, value)); _dataStore.Add(new KeyValuePair<string, string>(name, value));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment