Explorar el Código

MediaLibraryService: Set currentlyPlayingMedia return value as optinal

Soomin Lee hace 6 años
padre
commit
c7abccf26a
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      SharedSources/MediaLibraryService.swift

+ 2 - 2
SharedSources/MediaLibraryService.swift

@@ -304,8 +304,8 @@ extension MediaLibraryService {
 
     func savePlaybackState(from player: VLCPlaybackController) {
 
-        let media = player.currentlyPlayingMedia
-        guard let mlMedia = fetchMedia(with: media.url.absoluteURL) else {
+        let media: VLCMedia? = player.currentlyPlayingMedia
+        guard let mlMedia = fetchMedia(with: media?.url.absoluteURL) else {
             // we opened a url and not a local file
             return
         }