mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-03 14:00:32 +00:00
Fix possible NPE in PlayQueueNavigator
This commit is contained in:
parent
bf908f0b7d
commit
37af2c87e8
@ -138,10 +138,12 @@ public class PlayQueueNavigator implements MediaSessionConnector.QueueNavigator
|
|||||||
.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, player.getPlayQueue().size());
|
.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, player.getPlayQueue().size());
|
||||||
descBuilder.setExtras(additionalMetadata);
|
descBuilder.setExtras(additionalMetadata);
|
||||||
|
|
||||||
final Uri thumbnailUri = Uri.parse(
|
try {
|
||||||
ImageStrategy.choosePreferredImage(item.getThumbnails()));
|
descBuilder.setIconUri(Uri.parse(
|
||||||
if (thumbnailUri != null) {
|
ImageStrategy.choosePreferredImage(item.getThumbnails())));
|
||||||
descBuilder.setIconUri(thumbnailUri);
|
} catch (final Throwable e) {
|
||||||
|
// no thumbnail available at all, or the user disabled image loading,
|
||||||
|
// or the obtained url is not a valid `Uri`
|
||||||
}
|
}
|
||||||
|
|
||||||
return descBuilder.build();
|
return descBuilder.build();
|
||||||
|
Loading…
Reference in New Issue
Block a user