Skip to content

Commit

Permalink
give error message if default url doesn't exist in /compare
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Dec 19, 2023
1 parent 2d992b1 commit f841619
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/functions/textureComparison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export default async function textureComparison(
const displayMcmeta = structuredClone(mcmeta);

const displayed = parseDisplay(display);
const defaultURL = result.urls.default;

const dimension = await loadImage(defaultURL);
const dimension = await loadImage(result.urls.default).catch(() => null);
if (!dimension) return null; // default image doesn't exist, something is probably set up wrong
if (dimension.width * dimension.height * displayed.flat().length > 262144) return null;

// get texture urls into 2d array using the parsed display
Expand Down

0 comments on commit f841619

Please sign in to comment.