Skip to content

Commit 7b14a0a

Browse files
committed
[ts][webgl] Fix infinite loop for empty atlas.
1 parent 218841b commit 7b14a0a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎spine-ts/spine-core/src/AssetManagerBase.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ export class AssetManagerBase implements Disposable {
216216
try {
217217
const atlas = this.createTextureAtlas(path, atlasText);
218218
let toLoad = atlas.pages.length, abort = false;
219+
220+
if (toLoad === 0) {
221+
this.success(success, path, atlas);
222+
resolve(atlas);
223+
return;
224+
}
225+
219226
for (let page of atlas.pages) {
220227
this.loadTexture(!fileAlias ? parent + page.name : fileAlias[page.name!],
221228
(imagePath: string, texture: Texture) => {

0 commit comments

Comments
 (0)