Skip to content

Commit

Permalink
fix: negative index exception in update palette (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho authored Jul 8, 2023
1 parent 704fcca commit 0089d47
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/provider/proxy_playlist/proxy_playlist_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,12 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
return;
}
return Future.microtask(() async {
final activeTrack = state.tracks.elementAtOrNull(state.active ?? 0);

if (activeTrack == null) return;
if (state.activeTrack == null) return;

final palette = await PaletteGenerator.fromImageProvider(
UniversalImage.imageProvider(
TypeConversionUtils.image_X_UrlString(
activeTrack.album?.images,
state.activeTrack?.album?.images,
placeholder: ImagePlaceholder.albumArt,
),
height: 50,
Expand Down

0 comments on commit 0089d47

Please sign in to comment.