diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 2443b1d6fee..8afd501d221 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1890,19 +1890,23 @@ if(istype(H.wear_id, /obj/item/device/pda)) var/obj/item/device/pda/PDA = H.wear_id - id = PDA.id // The ID is contained inside the PDA - else - id = H.wear_id + if(!isnull(PDA.id)) // The PDA may contain no ID + id = PDA.id // The ID is contained inside the PDA - if(!id) - usr << "ERROR: Inform the coders that an [H.name] had wear_id but no ID on their ID slot." - dat += "ERROR" - else if(isnull(id.assignment)) - usr << "ERROR: Inform the coders that an [id.name] was checked for its assignment variable." + else + id = H.wear_id // The ID was on the ID slot + + if(!id) // Happens when there's no ID in the PDA located on the wear_id slot + dat += "[M.mind.assigned_role] (No ID)" + + else if(isnull(id.assignment)) // Preventing runtime errors blocking the player panel + usr << "ERROR: Inform the coders that an [id.name] was checked for its assignment variable, and it was null." dat += "ERROR" + else if(M.mind.assigned_role == id.assignment) // Polymorph dat += "[M.mind.assigned_role]" + else dat += "[M.mind.assigned_role] ([id.assignment])"