浏览代码

[unity] Fixed a potential null reference exception reported by a user.

Harald Csaszar 5 年之前
父节点
当前提交
7c2e2cb7ef
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs

@@ -182,7 +182,7 @@ namespace Spine.Unity {
 
 		/// <summary>Progresses the AnimationState according to the given deltaTime, and applies it to the Skeleton. Use Time.deltaTime to update manually. Use deltaTime 0 to update without progressing the time.</summary>
 		public void Update (float deltaTime) {
-			if (!valid)
+			if (!valid || state == null)
 				return;
 
 			deltaTime *= timeScale;