From 6d8319094696eda284a8808c778691f17898c37c Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 16 Nov 2020 13:00:31 +0100 Subject: [PATCH] [unity] Added null checks at BoundingBoxFollower classes to handle SkeletonData not being assigned. --- .../spine-unity/Components/Following/BoundingBoxFollower.cs | 2 ++ .../Components/Following/BoundingBoxFollowerGraphic.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs index 82aae46da..f841a02ef 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs @@ -115,6 +115,8 @@ namespace Spine.Unity { nameTable.Clear(); var skeleton = skeletonRenderer.skeleton; + if (skeleton == null) + return; slot = skeleton.FindSlot(slotName); int slotIndex = skeleton.FindSlotIndex(slotName); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs index 106a9810d..674a0fb04 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs @@ -115,6 +115,8 @@ namespace Spine.Unity { nameTable.Clear(); var skeleton = skeletonGraphic.Skeleton; + if (skeleton == null) + return; slot = skeleton.FindSlot(slotName); int slotIndex = skeleton.FindSlotIndex(slotName);