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

Merged
merged 1 commit into from
Feb 5, 2025

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.

@skoshelev skoshelev linked an issue Feb 5, 2025 that may be closed by this pull request
@skoshelev skoshelev merged commit ffaf12a into nopSolutions:develop Feb 5, 2025
@skoshelev
Copy link
Contributor

Hi, @danFbach!
many thanks for your contributions.

@danFbach danFbach deleted the patch-5 branch February 5, 2025 20:27
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.

Update PictureService.cs - NullReferenceException remedy
2 participants