From 0c40088574962c385b37a563ceb7469b55252b0d Mon Sep 17 00:00:00 2001 From: Niels G Date: Sat, 25 May 2024 13:52:00 +0200 Subject: [PATCH] Playlist images can be nullable --- .../Object Model/Playlist Objects/Playlist.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SpotifyWebAPI/Object Model/Playlist Objects/Playlist.swift b/Sources/SpotifyWebAPI/Object Model/Playlist Objects/Playlist.swift index 788574dc..aafa0f72 100644 --- a/Sources/SpotifyWebAPI/Object Model/Playlist Objects/Playlist.swift +++ b/Sources/SpotifyWebAPI/Object Model/Playlist Objects/Playlist.swift @@ -99,7 +99,7 @@ public struct Playlist: SpotifyURIConvertible, Hashab [1]: https://developer.spotify.com/documentation/general/guides/working-with-playlists/ */ - public let images: [SpotifyImage] + public let images: [SpotifyImage]? /// The object type. Always ``IDCategory/playlist``. public let type: IDCategory @@ -155,7 +155,7 @@ public struct Playlist: SpotifyURIConvertible, Hashab href: URL, id: String, uri: String, - images: [SpotifyImage] + images: [SpotifyImage]? ) { self.name = name self.items = items @@ -187,7 +187,7 @@ extension Playlist: Codable { // MARK: Decode Images - self.images = try container.decodeSpotifyImages(forKey: .images) + self.images = try? container.decodeSpotifyImages(forKey: .images) self.name = try container.decodeIfPresent(