fix both null condition (#260)

* fix both null condition

* simplify check condition

* simplify check condition
This commit is contained in:
zxx43
2026-08-14 17:21:26 +08:00
committed by GitHub
parent f948b5900e
commit b710cb6e9b
+1 -3
View File
@@ -850,14 +850,12 @@ export class Skeleton extends UIRenderer {
warnID(16410);
}
const skeletonInfo = this._skeletonCache!.getSkeletonInfo(this._skeletonData!);
if (this._skeletonInfo !== skeletonInfo) {
if (this._skeletonInfo !== skeletonInfo || (!this._skeletonInfo && !skeletonInfo)) {
this._destroySkeletonInfo(this._skeletonCache);
if (!skeletonInfo && this._cacheMode === SpineAnimationCacheMode.PRIVATE_CACHE) {
this._animCache = this._skeletonCache!.initAnimationCache(this.skeletonData!.uuid, this._skeletonData!, this._animationName);
}
this._skeletonInfo = this._skeletonCache!.createSkeletonInfo(this._skeletonData!);
}
if (this._skeletonInfo) {
this._skeleton = this._skeletonInfo.skeleton!;
}
} else {