Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NullReferenceException when no LogConsistencyProvider attribute is provided #3158

Merged
merged 1 commit into from
Jun 23, 2017
Merged

Conversation

Liversage
Copy link
Contributor

If a LogConsistencyProvider is configured with the name Default then a JournaledGrain without a LogConsistencyProviderAttribute will use that provider. However, a bug in a logging statement resulted in a NullReferenceException. The name of the provider was retrieved from the variable attr that is null when no attribute is specified.

The fix is to get the name of the provider from the provider itself.

It took me some time to pinpoint the location of this bug in the source code. Interestingly, when I opened the file in Visual Studio ReSharper flagged the exact statement I had located by code inspection with a green squiggly to indicate a possible NullReferenceException.

@sergeybykov
Copy link
Contributor

@dotnet-bot test netstandard-win-bvt

@sergeybykov sergeybykov added this to the 1.5.0 milestone Jun 23, 2017
@sergeybykov sergeybykov merged commit 5dedbd5 into dotnet:master Jun 23, 2017
@sergeybykov
Copy link
Contributor

Thank you, @Liversage!

sergeybykov pushed a commit that referenced this pull request Jul 3, 2017
jdom pushed a commit that referenced this pull request Jul 5, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2023
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.

3 participants