Skip to content

Commit

Permalink
Fix for loadSVG failure when loading with undefined data property
Browse files Browse the repository at this point in the history
  • Loading branch information
sam007mac committed Dec 18, 2024
1 parent 56f7975 commit 2c02812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/assets/loader/parsers/textures/loadSVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const loadSvg: LoaderParser<Texture | GraphicsContext, TextureSourceOptio
loader: Loader
): Promise<Texture | GraphicsContext>
{
if (asset.data.parseAsGraphicsContext ?? this.config.parseAsGraphicsContext)
if (asset.data?.parseAsGraphicsContext ?? this.config.parseAsGraphicsContext)
{
return loadAsGraphics(url);
}
Expand Down Expand Up @@ -119,7 +119,7 @@ async function loadAsTexture(

context.drawImage(image, 0, 0, width * resolution, height * resolution);

const { parseAsGraphicsContext: _p, ...rest } = asset.data;
const { parseAsGraphicsContext: _p, ...rest } = asset.data ?? {};
const base = new ImageSource({
resource: canvas,
alphaMode: 'premultiply-alpha-on-upload',
Expand Down

0 comments on commit 2c02812

Please sign in to comment.