diff --git a/api/outfitImage.js b/api/outfitImage.js index 0550cbc..d7d1372 100644 --- a/api/outfitImage.js +++ b/api/outfitImage.js @@ -175,6 +175,10 @@ async function loadLayerUrlsForSavedOutfit(outfitId, size) { ); } + if (!data.outfit) { + throw new Error(`outfit ${outfitId} not found`); + } + const { petAppearance, itemAppearances } = data.outfit; const visibleLayers = getVisibleLayers(petAppearance, itemAppearances); return visibleLayers