From e60884417193e2193d4615e510ecd95531f2c1ce Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 27 May 2021 17:01:20 -0700 Subject: [PATCH] Add better 404 message for outfit image --- api/outfitImage.js | 4 ++++ 1 file changed, 4 insertions(+) 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