From e6965622bd55fc5a9f656a7193c8061116f5364e Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 7 Oct 2023 14:34:44 +0200 Subject: [PATCH] Fix crash with disabled thumbnails when trying to play a stream --- .../java/org/schabi/newpipe/player/mediaitem/MediaItemTag.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/mediaitem/MediaItemTag.java b/app/src/main/java/org/schabi/newpipe/player/mediaitem/MediaItemTag.java index 1119fb903..346bb92fa 100644 --- a/app/src/main/java/org/schabi/newpipe/player/mediaitem/MediaItemTag.java +++ b/app/src/main/java/org/schabi/newpipe/player/mediaitem/MediaItemTag.java @@ -81,8 +81,9 @@ public interface MediaItemTag { @NonNull default MediaItem asMediaItem() { + final String thumbnailUrl = getThumbnailUrl(); final MediaMetadata mediaMetadata = new MediaMetadata.Builder() - .setArtworkUri(Uri.parse(getThumbnailUrl())) + .setArtworkUri(thumbnailUrl == null ? null : Uri.parse(thumbnailUrl)) .setArtist(getUploaderName()) .setDescription(getTitle()) .setDisplayTitle(getTitle())