From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:25:35 +0000 (+0000) Subject: return empty string for invalid identity (#29274) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a3ffe22e66f5049a8b5efa3e7eb5502636aa08c7;p=space-station-14.git return empty string for invalid identity (#29274) Co-authored-by: deltanedas <@deltanedas:kde.org> --- diff --git a/Content.Shared/IdentityManagement/Identity.cs b/Content.Shared/IdentityManagement/Identity.cs index 2fb53e3d5a..cdb3c81ada 100644 --- a/Content.Shared/IdentityManagement/Identity.cs +++ b/Content.Shared/IdentityManagement/Identity.cs @@ -15,6 +15,9 @@ public static class Identity /// public static string Name(EntityUid uid, IEntityManager ent, EntityUid? viewer=null) { + if (!uid.IsValid()) + return string.Empty; + var meta = ent.GetComponent(uid); if (meta.EntityLifeStage <= EntityLifeStage.Initializing) return meta.EntityName; // Identity component and such will not yet have initialized and may throw NREs