From 8093491b42fb833b86943b27cbcfb3c252a00013 Mon Sep 17 00:00:00 2001 From: Fernando Cortez Date: Wed, 24 Mar 2021 22:33:53 -0400 Subject: [PATCH] null guard added inside of target action for accessing a possibly destroyed reticule --- .../BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs b/Assets/BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs index 312559cd3..e3a081ec5 100644 --- a/Assets/BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs +++ b/Assets/BossRoom/Scripts/Client/Game/Action/TargetActionFX.cs @@ -55,8 +55,12 @@ public override bool Update() } else { - m_TargetReticule.transform.parent = null; - m_TargetReticule.SetActive(false); + // null check here in case the target was destroyed along with the target reticule + if (m_TargetReticule != null) + { + m_TargetReticule.transform.parent = null; + m_TargetReticule.SetActive(false); + } } }