Skip to content

Conversation

@mpidash
Copy link
Contributor

@mpidash mpidash commented Feb 19, 2024

ConvertComImportToGeneratedComInterfaceAnalyzer always assumed that an InterfaceTypeAttribute was present on interface types with ComImportAttribute, throwing a NullReferenceException if it was missing.
This PR also adds tests for each unsupported ComInterfaceType.

Not sure why there was no nullability warning in the original code.

Fixes #94968.

@ghost
Copy link

ghost commented Feb 19, 2024

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

Issue Details

ConvertComImportToGeneratedComInterfaceAnalyzer always assumed that an InterfaceTypeAttribute was present on interface types with ComImportAttribute, throwing a NullReferenceException if it was missing.
This PR also adds tests for each unsupported ComInterfaceType.

Not sure why there was no nullability warning in the original code.

Fixes #94968.

Author: mpidash
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

@jkoritzinsky jkoritzinsky merged commit 9562552 into dotnet:main Feb 21, 2024
@mpidash mpidash deleted the issue-94968 branch February 21, 2024 10:15
@elinor-fung
Copy link
Member

@jkoritzinsky would this be worth backporting, since it is affecting VS editing experience?

@jkoritzinsky
Copy link
Member

I think it's worthwhile to backport.

@jkoritzinsky
Copy link
Member

/backport to release/8.0-staging

@github-actions
Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/8025295750

@teo-tsirpanis teo-tsirpanis added the community-contribution Indicates that the PR has been added by a community member label Feb 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Runtime.InteropServices community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullReferenceException in ConvertComImportToGeneratedComInterfaceAnalyzer

4 participants