From cd1902cdf278257621831f1a3960fc35eff9f964 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sat, 5 Mar 2022 12:42:24 +0100 Subject: [PATCH] Fix EndRound exception when a mind doesn't have a character name nor valid entity. --- Content.Server/GameTicking/GameTicker.RoundFlow.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 88a7025fa1..975a7366c3 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -333,12 +333,12 @@ namespace Content.Server.GameTicking // Finish var antag = mind.AllRoles.Any(role => role.Antagonist); - var playerIcName = string.Empty; + var playerIcName = "Unknown"; if (mind.CharacterName != null) playerIcName = mind.CharacterName; - else if (mind.CurrentEntity != null) - playerIcName = EntityManager.GetComponent(mind.CurrentEntity.Value).EntityName; + else if (mind.CurrentEntity != null && TryName(mind.CurrentEntity.Value, out var icName)) + playerIcName = icName; var playerEndRoundInfo = new RoundEndMessageEvent.RoundEndPlayerInfo() {