Fix for issue 6768 NullRef when access Level when there are EventSource messages.
authorVance Morrison <vancemorrison@comcast.net>
Thu, 15 Sep 2016 15:37:03 +0000 (08:37 -0700)
committerVance Morrison <vancemorrison@comcast.net>
Mon, 26 Sep 2016 19:26:47 +0000 (12:26 -0700)
commit4a61f980d8b168a6387cdf88ac31bba021e71bc5
tree5f29ef86f9f035af1dc137b0c1e3690da48dd35e
parentcf352a44c0a12e60949c11a767364cb855e3ef6f
Fix for issue 6768 NullRef when access Level when there are EventSource messages.

See https://github.com/dotnet/coreclr/issues/6768 for mor details on the bug.

The issue is that EventSource is firing events (to report errors) before the EventSource
is completely initialized.   We dealt with many of the issues associated with this but
not all of them.   This change makes these special eventSource events (with ID of 0
 take the same codepath as for TraceLogging events (with negative IDs) when the
EventWrittenArgs properies are accessed.

Commit migrated from https://github.com/dotnet/coreclr/commit/c728f1faf06b5d77bd185f81939c55c1c0358ede
src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs