Skip to content

Commit 04dded0

Browse files
committed
Fixed a race condition with event types could already exist.
1 parent 722c000 commit 04dded0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Exceptionless/Models/Collections/SettingsDictionary.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,12 @@ private string GetTypeAndSourceSetting(string type, string source, string defaul
229229
Dictionary<string, bool> sourceDictionary;
230230
string sourcePrefix;
231231
if (!_typeSourceEnabled.TryGetValue(type, out sourceDictionary)) {
232-
sourcePrefix = "@@" + type + ":";
233-
_eventTypes.Add(type, sourcePrefix);
234232
sourceDictionary = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
235233
_typeSourceEnabled.Add(type, sourceDictionary);
234+
235+
sourcePrefix = "@@" + type + ":";
236+
if (!_eventTypes.ContainsKey(type))
237+
_eventTypes.Add(type, sourcePrefix);
236238
} else {
237239
sourcePrefix = _eventTypes[type];
238240
}

0 commit comments

Comments
 (0)