From 8239d392d45a797a63aa67dec61e9411d3d5c174 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sat, 11 Dec 2021 15:36:50 +0100 Subject: [PATCH] Fix after interact target GetComponent exception --- Content.Shared/Interaction/SharedInteractionSystem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 1f15f1b9e1..f04f4d102d 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -409,6 +409,9 @@ namespace Content.Shared.Interaction /// public async Task InteractDoAfter(EntityUid user, EntityUid used, EntityUid? target, EntityCoordinates clickLocation, bool canReach) { + if (target is {Valid: false}) + target = null; + var afterInteractEvent = new AfterInteractEvent(user, used, target, clickLocation, canReach); RaiseLocalEvent(used, afterInteractEvent, false); if (afterInteractEvent.Handled)