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

NullReferenceException if response is not configured. #87

Closed
perfectsquircle opened this issue May 4, 2021 · 3 comments
Closed

NullReferenceException if response is not configured. #87

perfectsquircle opened this issue May 4, 2021 · 3 comments
Milestone

Comments

@perfectsquircle
Copy link
Contributor

If a request is configured, but a response is never configured, a NullReferenceException is thrown when SendAsync is called on the HTTP client. This is confusing to the user and takes some time to unravel what went wrong.

mockHttp.Expect("/foo")
        .WithQueryString("bar", "bat")
        .WithQueryString("fizz", "buzz");
        // forgot to configure response

httpClient.GetAsync("/foo"); // throws NullReferenceException.
@0x326
Copy link

0x326 commented Sep 15, 2022

I actually just ran into this myself, so I can confirm.

@FroggieFrog
Copy link

@richardszalay Is there any chance of a new release on Nuget with this fix included?

@richardszalay richardszalay added this to the 7.0.0 milestone Oct 12, 2023
@richardszalay
Copy link
Owner

Verion 7.0.0 includes this change.

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

No branches or pull requests

4 participants