Skip to content

Commit

Permalink
Merge pull request #23 from Navideck/fix_crash_when_empty_album_art
Browse files Browse the repository at this point in the history
Fix crash when empty album art
  • Loading branch information
iberatkaya committed Dec 11, 2022
2 parents 7edc212 + 7014cd4 commit 75f3d60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/playify.dart
Expand Up @@ -288,11 +288,15 @@ class Playify {
}
final resobj = Map<String, dynamic>.from(result);
final artist = Artist(albums: [], name: resobj['artist']);
Uint8List? coverArt;
try {
coverArt = resobj['image'];
} catch (_) {}
final album = Album(
songs: [],
title: resobj['albumTitle'],
albumTrackCount: resobj['albumTrackCount'] ?? 0,
coverArt: resobj['image'],
coverArt: coverArt,
discCount: resobj['discCount'] ?? 0,
artistName: artist.name);
final song = Song.fromJson(resobj);
Expand Down

0 comments on commit 75f3d60

Please sign in to comment.