From 7a1ebc6c97ac7759e6feb84d3cd3c59439a3ca17 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 31 Oct 2022 19:35:35 +1300 Subject: [PATCH] Fix ContactInteractionEvent exceptions (#12314) --- Content.Shared/Interaction/SharedInteractionSystem.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 6be9761a9e..45b8e9c204 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -1013,6 +1013,10 @@ namespace Content.Shared.Interaction if (uidB == null || args?.Handled == false) return; + // Entities may no longer exist (banana was eaten, or human was exploded)? + if (!Exists(uidA) || !Exists(uidB)) + return; + RaiseLocalEvent(uidA, new ContactInteractionEvent(uidB.Value)); RaiseLocalEvent(uidB.Value, new ContactInteractionEvent(uidA)); }