diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs index 3c13bce8a6..c8186223d1 100644 --- a/Content.Server/Station/Systems/StationSpawningSystem.cs +++ b/Content.Server/Station/Systems/StationSpawningSystem.cs @@ -105,9 +105,12 @@ public sealed class StationSpawningSystem : EntitySystem return jobEntity; } - var entity = EntityManager.SpawnEntity( - _prototypeManager.Index(profile?.Species ?? HumanoidAppearanceSystem.DefaultSpecies).Prototype, - coordinates); + if (!_prototypeManager.TryIndex(profile?.Species ?? HumanoidAppearanceSystem.DefaultSpecies, out SpeciesPrototype? species)) + { + species = _prototypeManager.Index(HumanoidAppearanceSystem.DefaultSpecies); + } + + var entity = EntityManager.SpawnEntity(species.Prototype, coordinates); if (job?.StartingGear != null) { diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index ecacf14a09..7bcdfaf6c7 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -354,7 +354,11 @@ namespace Content.Shared.Preferences { var prototypeManager = IoCManager.Resolve(); - prototypeManager.TryIndex(Species, out var speciesPrototype); + if (!prototypeManager.TryIndex(Species, out var speciesPrototype)) + { + Species = SharedHumanoidAppearanceSystem.DefaultSpecies; + speciesPrototype = prototypeManager.Index(Species); + } var sex = Sex switch {