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

null-propagation Errors #278

Open
Platonenkov opened this issue Jul 12, 2022 · 6 comments
Open

null-propagation Errors #278

Platonenkov opened this issue Jul 12, 2022 · 6 comments

Comments

@Platonenkov
Copy link

When I use in template {{np(User.Range, ""Not registred"")}} I get an error ')' or ',' expected
User here is null.
If I use {{np(User.Range, null)}} I get an error The 'np' (null-propagation) function requires the first argument to be a MemberExpression, ParameterExpression or MethodCallExpression

how to use np correctly?

@Platonenkov
Copy link
Author

trying different options, came to this solution:

{{User == null ? "User error" : User.Range.ToString()}}

are there other ways?

@b0bi79
Copy link
Member

b0bi79 commented Jul 15, 2022

Hi.
Try this {{np(User.Range, "Not registred")}}

@Platonenkov
Copy link
Author

Same

The 'np' (null-propagation) function requires the first argument to be a MemberExpression, ParameterExpression or MethodCallExpression

@Pankraty
Copy link
Member

Please provide a sample file and reproduction code for I could investigate the issue.

@dakidd88
Copy link

Delete

@dakidd88
Copy link

Close project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants