1
0
mirror of https://github.com/lexogrine/dota2-react-hud.git synced 2025-12-10 01:52:49 +01:00

fixed nullyfing

This commit is contained in:
Hubert Walczak 2024-09-04 10:51:53 +02:00
parent 820350d36b
commit 341d28bee9
No known key found for this signature in database
GPG Key ID: 17BB1C9355357860

View File

@ -21,9 +21,9 @@ export function stringToClock(time: string | number, pad = true) {
const ScoreboardPlayer = ({ player }: { player: Player }) => { const ScoreboardPlayer = ({ player }: { player: Player }) => {
const neutralItem = player.items.find(item => item.type === 'neutral'); const neutralItem = player.items.find(item => item.type === 'neutral');
const facetIndex = player.hero?.facetIndex; const facetIndex = player.hero?.facetIndex ?? null;
const facets = heroFacets[(player.hero?.name || "")] ?? []; const facets = heroFacets[(player.hero?.name || "")] ?? [];
const facet = facetIndex ? facets[facetIndex] : null; const facet = facetIndex !== null ? facets[facetIndex] : null;
if(facet){ if(facet){
const _facetUrl = getAssetURL(facet.icon, "facets") const _facetUrl = getAssetURL(facet.icon, "facets")