Adding error case when texture is empty
This commit is contained in:
parent
52b5027702
commit
b6b6c7f15f
@ -96,6 +96,12 @@ export const createLoadingPromise = (
|
||||
return;
|
||||
});
|
||||
|
||||
// If for some reason, the "img" is empty, let's reject the promise.
|
||||
if (!playerResourceDescriptor.img) {
|
||||
console.warn("Tried to load an empty texture for a Woka");
|
||||
rej(playerResourceDescriptor);
|
||||
return;
|
||||
}
|
||||
loadPlugin.spritesheet(playerResourceDescriptor.id, playerResourceDescriptor.img, frameConfig);
|
||||
const errorCallback = (file: { src: string }) => {
|
||||
if (file.src !== playerResourceDescriptor.img) return;
|
||||
|
@ -18,7 +18,7 @@ import { soundManager } from "./SoundManager";
|
||||
import { SharedVariablesManager } from "./SharedVariablesManager";
|
||||
import { EmbeddedWebsiteManager } from "./EmbeddedWebsiteManager";
|
||||
|
||||
import { lazyLoadPlayerCharacterTextures, loadWokaTexture } from "../Entity/PlayerTexturesLoadingManager";
|
||||
import { lazyLoadPlayerCharacterTextures } from "../Entity/PlayerTexturesLoadingManager";
|
||||
import { lazyLoadCompanionResource } from "../Companion/CompanionTexturesLoadingManager";
|
||||
import { iframeListener } from "../../Api/IframeListener";
|
||||
import { DEBUG_MODE, JITSI_URL, MAX_PER_GROUP, POSITION_DELAY } from "../../Enum/EnvironmentVariable";
|
||||
|
Loading…
Reference in New Issue
Block a user