From 841c96d56a88c611dff82b82db080e2176532a31 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 13 Mar 2021 02:21:32 -0800 Subject: [PATCH] Fix crash when knownGlitches is undefined Not sure exactly when in the flow this happens! But spooky! Don't crash! --- src/app/WardrobePage/OutfitControls.js | 2 +- src/app/components/HTML5Badge.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/WardrobePage/OutfitControls.js b/src/app/WardrobePage/OutfitControls.js index 9c1c62d3..432a06e9 100644 --- a/src/app/WardrobePage/OutfitControls.js +++ b/src/app/WardrobePage/OutfitControls.js @@ -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( diff --git a/src/app/components/HTML5Badge.js b/src/app/components/HTML5Badge.js index 3b7909e8..19960afb 100644 --- a/src/app/components/HTML5Badge.js +++ b/src/app/components/HTML5Badge.js @@ -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") ); }