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

Questionable test/cast pair in OrleansJsonSerializer.cs #8322

Closed
Jens-G opened this issue Feb 18, 2023 · 1 comment
Closed

Questionable test/cast pair in OrleansJsonSerializer.cs #8322

Jens-G opened this issue Feb 18, 2023 · 1 comment
Labels
Milestone

Comments

@Jens-G
Copy link
Contributor

Jens-G commented Feb 18, 2023

There is a questionable test/cast pair in OrleansJsonSerializer.cs:

If the instance is Addressable but not a GrainReference, you get an NPE next.

Would it maybe more correct to test sth along of objectType is GrainReference?

@ghost ghost added the Needs: triage 🔍 label Feb 18, 2023
@ReubenBond
Copy link
Member

ReubenBond commented Feb 18, 2023

Well spotted. It should be cast to IAddressable and converted to GrainReference using the non-generic AsReference extension method:

internal static GrainReference AsReference(this IAddressable grain)

Would you be willing to open a PR?

@adityamandaleeka adityamandaleeka added this to the 7.1.1 milestone Feb 22, 2023
Jens-G added a commit to Jens-G/orleans that referenced this issue Feb 22, 2023
@Jens-G Jens-G closed this as completed Mar 11, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants