Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix NRE in DiagnosticSourceListener when property values are null #143

Merged
merged 2 commits into from
Jan 16, 2018
Merged

Conversation

pharring
Copy link
Member

@pharring pharring commented Jan 15, 2018

The DiagnosticSourceListener tests project got removed with the last round of project shuffling (#135)
This puts it back.

Also fix a bug (NRE) when property values are null and add a test to cover that case.

@pharring pharring changed the title Put back DiagnosticSourceListener tests Fix NRE in DiagnosticSourceListener when property values are null Jan 15, 2018
@SergeyKanzhelev SergeyKanzhelev merged commit 969e71a into microsoft:develop Jan 16, 2018
@SergeyKanzhelev
Copy link
Contributor

@pharring build failed with the error. Can you please fix?

3 error(s), 10 warning(s)

Build - 3 error(s), 10 warning(s)
src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61):src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61,0): Error CA1305: Microsoft.Globalization : Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'DiagnosticSourceListenerSubscription.OnNext(KeyValuePair<string, object>)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify System.Globalization.CultureInfo.CurrentCulture as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify System.Globalization.CultureInfo.InvariantCulture.
src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61):src\DiagnosticSourceListener\DiagnosticSourceListenerSubscription.cs(61,0): Error CA1305: Microsoft.Globalization : Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'DiagnosticSourceListenerSubscription.OnNext(KeyValuePair<string, object>)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'.
Process 'msbuild.exe' exited with code '1'.

@pharring
Copy link
Member Author

@SergeyKanzhelev ugh! Sorry about that - I should have done a Release build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants