Fix crash when knownGlitches is undefined

Not sure exactly when in the flow this happens! But spooky! Don't crash!
This commit is contained in:
Emi Matchu 2021-03-13 02:21:32 -08:00
parent 1f7ef43e8b
commit 841c96d56a
2 changed files with 2 additions and 2 deletions

View file

@ -307,7 +307,7 @@ function OutfitKnownGlitchesBadge({ appearance }) {
// Look for items with the OFFICIAL_SVG_IS_INCORRECT glitch.
for (const item of appearance.items) {
const itemHasOfficialSvgIsIncorrect = item.appearance.layers.some((l) =>
l.knownGlitches.includes("OFFICIAL_SVG_IS_INCORRECT")
(l.knownGlitches || []).includes("OFFICIAL_SVG_IS_INCORRECT")
);
if (itemHasOfficialSvgIsIncorrect) {
glitchMessages.push(

View file

@ -138,7 +138,7 @@ export function layerUsesHTML5(layer) {
layer.canvasMovieLibraryUrl ||
// If this glitch is applied, then `svgUrl` will be null, but there's still
// an HTML5 manifest that the official player can render.
layer.knownGlitches.includes("OFFICIAL_SVG_IS_INCORRECT")
(layer.knownGlitches || []).includes("OFFICIAL_SVG_IS_INCORRECT")
);
}