From a3ffe22e66f5049a8b5efa3e7eb5502636aa08c7 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:25:35 +0000 Subject: [PATCH] return empty string for invalid identity (#29274) Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Shared/IdentityManagement/Identity.cs | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.51.2