Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Pixel email - prevent for null exception when email ident not exists

KrzysztofPajak8e5b3e984fa5
diff --git a/src/Web/Grand.Web/Controllers/PixelController.cs b/src/Web/Grand.Web/Controllers/PixelController.cs
index 373a3bb33..9b88fa65f 100644
--- a/src/Web/Grand.Web/Controllers/PixelController.cs
+++ b/src/Web/Grand.Web/Controllers/PixelController.cs
@@ -19,10 +19,10 @@ namespace Grand.Web.Controllers
{
if (!string.IsNullOrEmpty(emailId))
{
- if (!Request.Headers[HeaderNames.Referer].ToString().ToLowerInvariant().Contains("Admin/QueuedEmail/Edit".ToLowerInvariant()))
+ if (!Request.Headers[HeaderNames.Referer].ToString().ToLowerInvariant().Contains("admin/queuedemail/edit/".ToLowerInvariant()))
{
var eueuedEmail = await queuedEmailService.GetQueuedEmailById(emailId);
- if (!eueuedEmail.ReadOnUtc.HasValue)
+ if (eueuedEmail != null && !eueuedEmail.ReadOnUtc.HasValue)
{
eueuedEmail.ReadOnUtc = DateTime.UtcNow;
await queuedEmailService.UpdateQueuedEmail(eueuedEmail);