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

AttributeArgument with null value, TypedConstant ToString throws NullReferenceException #87

Closed
Xriuk opened this issue Aug 1, 2023 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Xriuk
Copy link

Xriuk commented Aug 1, 2023

I have an attribute which receives a null argument, and when retrieving it from the model, it retrieves the AttributeArgument but it throws when I try to print it, because the Value inside it is null.
I guess the problem is here:
https://github.com/NeVeSpl/NTypewriter/blob/23a40b936caf1a2682bc97500de407bd6e30884a/NTypewriter.CodeModel.Roslyn/TypedConstant.cs#L35C78-L35C78
Because the typedConstant itself is not null, but its Value property is

@NeVeSpl NeVeSpl added the bug Something isn't working label Aug 1, 2023
NeVeSpl added a commit that referenced this issue Aug 1, 2023
@NeVeSpl NeVeSpl added this to the 0.4.4.1 milestone Aug 1, 2023
@NeVeSpl NeVeSpl self-assigned this Aug 1, 2023
@NeVeSpl
Copy link
Owner

NeVeSpl commented Aug 1, 2023

Indeed, thank you for noticing that.

@NeVeSpl NeVeSpl closed this as completed Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants