diff --git a/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs index 6c1fbd6a..310386e7 100644 --- a/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/SlotSettingsPage.cshtml.cs @@ -29,14 +29,26 @@ public class SlotSettingsPage : BaseLayout if (avatarHash != null) this.Slot.IconHash = avatarHash; - name = CensorHelper.FilterMessage(name); - if (this.Slot.Name != name && name.Length <= 64) this.Slot.Name = name; + if (name != null) + { + name = CensorHelper.FilterMessage(name); + if (this.Slot.Name != name && name.Length <= 64) + this.Slot.Name = name; + } - description = CensorHelper.FilterMessage(description); - if (this.Slot.Description != description && description.Length <= 512) this.Slot.Description = description; + if (description != null) + { + description = CensorHelper.FilterMessage(description); + if (this.Slot.Description != description && description?.Length <= 512) + this.Slot.Description = description; + } - labels = LabelHelper.RemoveInvalidLabels(labels); - if (this.Slot.AuthorLabels != labels) this.Slot.AuthorLabels = labels; + if (labels != null) + { + labels = LabelHelper.RemoveInvalidLabels(labels); + if (this.Slot.AuthorLabels != labels) + this.Slot.AuthorLabels = labels; + } // ReSharper disable once InvertIf if (this.Database.ChangeTracker.HasChanges()) diff --git a/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs index a6b8596d..6c314136 100644 --- a/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/UserSettingsPage.cshtml.cs @@ -33,9 +33,12 @@ public class UserSettingsPage : BaseLayout if (avatarHash != null) this.ProfileUser.IconHash = avatarHash; - biography = CensorHelper.FilterMessage(biography); - - if (this.ProfileUser.Biography != biography && biography.Length <= 512) this.ProfileUser.Biography = biography; + if (biography != null) + { + biography = CensorHelper.FilterMessage(biography); + if (this.ProfileUser.Biography != biography && biography.Length <= 512) + this.ProfileUser.Biography = biography; + } if (ServerConfiguration.Instance.Mail.MailEnabled && SanitizationHelper.IsValidEmail(email) &&