Fix ContactInteractionEvent exceptions (#12314)

This commit is contained in:
Leon Friedrich
2022-10-31 19:35:35 +13:00
committed by GitHub
parent 8c73cfb06d
commit 7a1ebc6c97

View File

@@ -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));
}