From 9a10c672a699866fe57073a9effdd8f0936bcbda Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 19 Nov 2020 00:37:16 +1100 Subject: [PATCH] Fix SharedPullable exception (#2431) * Fix SharedPullable exception * Smug in a bucket * Logging Co-authored-by: Metal Gear Sloth --- .../Components/Pulling/SharedPullableComponent.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Shared/GameObjects/Components/Pulling/SharedPullableComponent.cs b/Content.Shared/GameObjects/Components/Pulling/SharedPullableComponent.cs index 114a7428e9..79bbf6e7c9 100644 --- a/Content.Shared/GameObjects/Components/Pulling/SharedPullableComponent.cs +++ b/Content.Shared/GameObjects/Components/Pulling/SharedPullableComponent.cs @@ -11,6 +11,7 @@ using Robust.Shared.GameObjects.ComponentDependencies; using Robust.Shared.GameObjects.Components; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Serialization; @@ -181,7 +182,13 @@ namespace Content.Shared.GameObjects.Components.Pulling return; } - Puller = Owner.EntityManager.GetEntity(state.Puller.Value); + if (!Owner.EntityManager.TryGetEntity(state.Puller.Value, out var entity)) + { + Logger.Error($"Invalid entity {state.Puller.Value} for pulling"); + return; + } + + Puller = entity; } public override void HandleMessage(ComponentMessage message, IComponent? component)