From 8b1be6edee3260bf0a179a4bbbdbe6281d1c0c6d Mon Sep 17 00:00:00 2001 From: Acruid Date: Sat, 16 Nov 2019 14:39:52 -0800 Subject: [PATCH] Fixes the client crashing when closed. When disconnecting from a server, _playerManager.LocalPlayer is set to null before the entity components are disposed. Previously this would throw a nullref exception in ClientStatusEffectsComponent, now it properly checks for the null value. This resolves #435. --- .../GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs b/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs index b661dd3999..6c0d77889f 100644 --- a/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/ClientStatusEffectsComponent.cs @@ -32,7 +32,7 @@ namespace Content.Client.GameObjects.Components.Mobs /// /// Allows calculating if we need to act due to this component being controlled by the current mob /// - private bool CurrentlyControlled => _playerManager.LocalPlayer.ControlledEntity == Owner; + private bool CurrentlyControlled => _playerManager.LocalPlayer != null && _playerManager.LocalPlayer.ControlledEntity == Owner; protected override void Shutdown() {