Skip to content

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented Jan 15, 2025

No description provided.

@jkotas
Copy link
Member Author

jkotas commented Jan 15, 2025

Found in #111311 (comment)

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

// Getting the attributes has failed, return null. One of the reasons
// can be that the member has attributes defined in an assembly that is missing.
return [];
return null;
Copy link
Member Author

Choose a reason for hiding this comment

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

Caller casts this to StateMachineAttribute[]. Casting empty Attribute[] to StateMachineAttribute[] was guaranteed to fail.

@jkotas
Copy link
Member Author

jkotas commented Jan 15, 2025

@jkotas jkotas requested review from ViktorHofer and Copilot January 15, 2025 22:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackTrace.cs:421

  • The change to return null instead of an empty array should be covered by tests to ensure that the new behavior is correctly handled.
private static Attribute[]? GetCustomAttributesSafe(MemberInfo memberInfo, Type attributeType, bool inherit)

@teo-tsirpanis
Copy link
Contributor

Oops, thanks!

Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

Thank you

@ViktorHofer ViktorHofer merged commit e8f4678 into dotnet:main Jan 16, 2025
135 of 139 checks passed
@jkotas jkotas deleted the StateMachine branch January 21, 2025 18:09
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2025
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.

3 participants