diff --git a/ProjectLighthouse.Servers.Website/Pages/UserPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/UserPage.cshtml.cs index 64bfb501..05cb5671 100644 --- a/ProjectLighthouse.Servers.Website/Pages/UserPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/UserPage.cshtml.cs @@ -45,7 +45,8 @@ public class UserPage : BaseLayout if (this.ProfileUser == null) return this.NotFound(); string userSlug = this.ProfileUser.GenerateSlug(); - if (slug == null || userSlug != slug) + // Only redirect if there is a valid slug for this user and the current slug doesn't match + if (!string.IsNullOrWhiteSpace(userSlug) && (slug == null || userSlug != slug)) { return this.Redirect($"~/user/{userId}/{userSlug}"); }