From 9dc7ce27e1b8d3457b49853d889360dc7996404f Mon Sep 17 00:00:00 2001 From: Slendy Date: Sat, 23 Dec 2023 20:07:52 -0600 Subject: [PATCH] Fix infinite redirect when slot name generates empty slug --- ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml.cs index d1309d69..86aa0cd9 100644 --- a/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/SlotPage.cshtml.cs @@ -47,7 +47,8 @@ public class SlotPage : BaseLayout return this.NotFound(); string slotSlug = slot.GenerateSlug(); - if (slug == null || slotSlug != slug) + // Only redirect if there is a valid slug for this level and the current slug doesn't match + if (!string.IsNullOrWhiteSpace(slotSlug) && (slug == null || slotSlug != slug)) { return this.Redirect($"~/slot/{id}/{slotSlug}"); }