Prevent potential TypeError

"sourcesByLanguage" can be empty while the sources are still loading
This commit is contained in:
schroda
2026-01-15 01:22:46 +01:00
parent 081d37a459
commit bc077bdad7

View File

@@ -87,7 +87,7 @@ export const SourceLanguageSelect = ({
return 0; return 0;
} }
return sourcesByLanguage[language].length ?? 0; return sourcesByLanguage[language]?.length ?? 0;
}), }),
[sourcesByLanguage, languagesSortedBySelectState], [sourcesByLanguage, languagesSortedBySelectState],
); );