fix: custom image helper null exception

This commit is contained in:
Kingkor Roy Tirtho 2026-06-05 10:40:38 +06:00
parent e1149537b1
commit 33e1f3bef5

View File

@ -33,7 +33,8 @@ extension SpotubeImageExtensions on List<SpotubeImageObject>? {
int index = 1,
required ImagePlaceholder placeholder,
}) {
final sortedImage = this?.sorted((a, b) => (a.width ?? 0).compareTo(b.width ?? 0));
final sortedImage =
this?.sorted((a, b) => (a.width ?? 0).compareTo(b.width ?? 0));
return sortedImage != null && sortedImage.isNotEmpty
? sortedImage[