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

Update PictureService.cs - NullReferenceException remedy #7480

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

danFbach
Copy link
Contributor

@danFbach danFbach commented Jan 2, 2025

This is an edge case - my plugin generates invoices in a background task, in which the HttpContext is null, which produces System.NullReferenceException: Object reference not set to an instance of an object.
HttpContext should have a null check just like Request does and this should not have any negative side effects, since null is just converted to string.Empty anyway.

This is an edge case - my plugin generates invoices in a background task, in which the HttpContext in null, which produces `System.NullReferenceException: Object reference not set to an instance of an object.` `HttpContext` should have a null check just like `Request` does and this should not have any negative side effects, since null is just converted to `string.Empty` anyway.
@danFbach
Copy link
Contributor Author

danFbach commented Jan 2, 2025

It looks like inside of WebHelper this check is performed using the internalIsRequestAvailable() method on many of the helper functions.

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

Successfully merging this pull request may close these issues.

1 participant