1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 11:02:35 +01:00

Fix possible NPE in PlayQueueNavigator

This commit is contained in:
Stypox 2023-05-02 21:12:32 +02:00
parent bf908f0b7d
commit 37af2c87e8
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -138,10 +138,12 @@ public class PlayQueueNavigator implements MediaSessionConnector.QueueNavigator
.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, player.getPlayQueue().size());
descBuilder.setExtras(additionalMetadata);
final Uri thumbnailUri = Uri.parse(
ImageStrategy.choosePreferredImage(item.getThumbnails()));
if (thumbnailUri != null) {
descBuilder.setIconUri(thumbnailUri);
try {
descBuilder.setIconUri(Uri.parse(
ImageStrategy.choosePreferredImage(item.getThumbnails())));
} 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();