diff --git a/spine-unity/Assets/spine-unity/Editor/AnimationReferenceAssetEditor.cs b/spine-unity/Assets/spine-unity/Editor/AnimationReferenceAssetEditor.cs index f91576888..596efbb42 100644 --- a/spine-unity/Assets/spine-unity/Editor/AnimationReferenceAssetEditor.cs +++ b/spine-unity/Assets/spine-unity/Editor/AnimationReferenceAssetEditor.cs @@ -63,8 +63,15 @@ namespace Spine.Unity.Editor { public override void OnInspectorGUI () { animationNameProperty = animationNameProperty ?? serializedObject.FindProperty("animationName"); string animationName = animationNameProperty.stringValue; - Animation animation = ThisSkeletonDataAsset.GetSkeletonData(true).FindAnimation(animationName); - bool animationNotFound = animation == null; + + Animation animation = null; + if (ThisSkeletonDataAsset != null) { + var skeletonData = ThisSkeletonDataAsset.GetSkeletonData(true); + if (skeletonData != null) { + animation = skeletonData.FindAnimation(animationName); + } + } + bool animationNotFound = (animation == null); if (changeNextFrame) { changeNextFrame = false;