diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index 713175d2a8..19cb35a1c0 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -643,10 +643,14 @@ IDependencyCollection collection { name = GetName(Species, gender); } - - var customspeciename = speciesPrototype.CustomName - ? FormattedMessage.RemoveMarkup(Customspeciename ?? "")[..MaxNameLength] - : ""; + + var customspeciename = + !speciesPrototype.CustomName + || string.IsNullOrEmpty(Customspeciename) + ? "" + : Customspeciename.Length > MaxNameLength + ? FormattedMessage.RemoveMarkup(Customspeciename)[..MaxNameLength] + : FormattedMessage.RemoveMarkup(Customspeciename); string flavortext; if (FlavorText.Length > MaxDescLength)