Skip to content

LoggingSourceGenerator - Fixes InvalidCastException when using other attributes#67179

Merged
maryamariyan merged 1 commit intodotnet:mainfrom
maryamariyan:fix-ice
Mar 26, 2022
Merged

LoggingSourceGenerator - Fixes InvalidCastException when using other attributes#67179
maryamariyan merged 1 commit intodotnet:mainfrom
maryamariyan:fix-ice

Conversation

@maryamariyan
Copy link
Contributor

  • alongside LoggerMessageAttribute

Fixes #67167

@ghost
Copy link

ghost commented Mar 26, 2022

Tagging subscribers to this area: @dotnet/area-extensions-logging
See info in area-owners.md if you want to be subscribed.

Issue Details
  • alongside LoggerMessageAttribute

Fixes #67167

Author: maryamariyan
Assignees: -
Labels:

area-Extensions-Logging

Milestone: -

@maryamariyan maryamariyan merged commit 0713627 into dotnet:main Mar 26, 2022
ImmutableArray<AttributeData>? boundAttributes = logMethodSymbol?.GetAttributes();

if (boundAttrbutes == null)
if (boundAttributes == null || boundAttributes!.Value.Length == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you need a ! here? You just checked it for null on the same line.

radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logging Source Generator fails with a InvalidCastException

3 participants