From 8caea035ed364be95e04bb3b6a38ed5c99acef6b Mon Sep 17 00:00:00 2001 From: MathieuG-P <40181755+Zagrios@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:22:19 +0100 Subject: [PATCH] [bugfix] fix black screen under certain condition when loading maps --- .../maps-mangement-components/maps-row.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/maps-mangement-components/maps-row.component.tsx b/src/renderer/components/maps-mangement-components/maps-row.component.tsx index bad81078..d9836ffe 100644 --- a/src/renderer/components/maps-mangement-components/maps-row.component.tsx +++ b/src/renderer/components/maps-mangement-components/maps-row.component.tsx @@ -26,7 +26,7 @@ export const MapsRow = memo(({ maps, style, selectedMaps$, onMapSelect, onMapDel if (map.bsaverInfo?.versions[0]?.diffs) { map.bsaverInfo.versions[0].diffs.forEach(diff => { const arr = res.get(diff.characteristic) || []; - const diffName = map.mapInfo.difficulties.find(set => set.characteristic === diff.characteristic && set.difficulty === diff.difficulty).difficultyLabel || diff.difficulty; + const diffName = map.mapInfo.difficulties.find(set => set.characteristic === diff.characteristic && set.difficulty === diff.difficulty)?.difficultyLabel || diff.difficulty; arr.push({ name: diffName, type: diff.difficulty, stars: diff.stars }); res.set(diff.characteristic, arr); }); @@ -35,7 +35,7 @@ export const MapsRow = memo(({ maps, style, selectedMaps$, onMapSelect, onMapDel map.mapInfo.difficulties.forEach(diff => { const arr = res.get(diff.characteristic) || []; - arr.push({ name: diff.difficultyLabel || diff.difficulty, type: diff.difficulty, stars: null }); + arr.push({ name: diff?.difficultyLabel || diff.difficulty, type: diff.difficulty, stars: null }); }); return res;