Prevent null values from being censored

This commit is contained in:
Slendy 2023-04-03 01:02:41 -05:00
parent 89556d5dfa
commit d6788f0965
No known key found for this signature in database
GPG key ID: 7288D68361B91428
2 changed files with 24 additions and 9 deletions

View file

@ -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())