Fix after interact target GetComponent exception

This commit is contained in:
Vera Aguilera Puerto
2021-12-11 15:36:50 +01:00
parent 63a138eaae
commit 8239d392d4

View File

@@ -409,6 +409,9 @@ namespace Content.Shared.Interaction
/// </summary>
public async Task<bool> 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)