From 89cea5648b21d48bfe1af0e3c5d56c8b6bb63de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Fri, 11 Aug 2023 16:44:00 +0200 Subject: [PATCH] Fix MediaController crash --- .../ch/srgssr/pillarbox/demo/service/DemoMediaLibraryService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/service/DemoMediaLibraryService.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/service/DemoMediaLibraryService.kt index ad9a7d42b..a2e1b04b1 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/service/DemoMediaLibraryService.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/service/DemoMediaLibraryService.kt @@ -116,7 +116,7 @@ class DemoMediaLibraryService : PillarboxMediaLibraryService() { * For MediaItem with only id, like urn, it is fine. But one with uri not, as the localConfiguration is null here. * We have to get the orignal mediaItem with uri set. */ - return Futures.immediateFuture(mediaItems.map { demoBrowser.getMediaItemFromId(it.mediaId)!! }.toMutableList()) + return Futures.immediateFuture(mediaItems.map { demoBrowser.getMediaItemFromId(it.mediaId) ?: it }.toMutableList()) } override fun onSearch(