fix: do not match scale if localization empty

Signed-off-by: The one with the braid <info@braid.business>
This commit is contained in:
The one with the braid 2024-02-06 08:06:04 +01:00
parent 9e85dc1a8f
commit d294a50ea4

View file

@ -11,6 +11,7 @@ abstract class FileMatcher {
Locale? locale,
}) {
final localized = matchLocale(files: files, name: 'logo', extension: 'png');
if (localized.isEmpty) return null;
final scaled = matchScale(files: localized, name: 'logo', extension: 'png');
final file = files.singleWhere((element) => element == scaled);
return file;