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

.Net: Handle null parameter values in Handlebars positional arguments #8522

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

andhesky
Copy link
Contributor

@andhesky andhesky commented Sep 4, 2024

Motivation and Context

This change makes it easier to debug issues with parameter passing using positional arguments in Handlebars templates by matching the behavior of hash arguments when a null InputVariable is passed.

Previously, the IsExpectedParameterType method would throw when it tried to check the type of a null object

Description

Passing a null parameter would previous cause a null reference exception for positional arguments. It would throw a KernelException for hash arguments. Change behavior of positional arguments to throw a KernelException to match behavior.

Adds tests for both cases as well as the positive test case where a argument is passed properly

Contribution Checklist

Passing a null parameter would previous cause a null reference exception for positional arguments.
It would throw a KernelException for hash arguments.
Change behavior of positional arguments to throw a KernelException to match behavior.

Adds tests for both cases as well as the positive test case where a argument is passed properly
@andhesky andhesky requested a review from a team as a code owner September 4, 2024 18:33
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Sep 4, 2024
@github-actions github-actions bot changed the title Handle null parameter values in Handlebars positional arguments .Net: Handle null parameter values in Handlebars positional arguments Sep 4, 2024
@markwallace-microsoft markwallace-microsoft self-assigned this Sep 4, 2024
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Sep 4, 2024
Merged via the queue into microsoft:main with commit c500de3 Sep 4, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants