Prevent potential TypeError
"sourcesByLanguage" can be empty while the sources are still loading
This commit is contained in:
@@ -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],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user