From 169149b3e123bc18288412f29a4abf67e4625cc6 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 25 Aug 2022 20:11:39 +0800 Subject: [PATCH] Dont force unwrap author and title --- .../Sources/Services/AudioSession/AudioSession.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Services/AudioSession/AudioSession.swift b/apple/OmnivoreKit/Sources/Services/AudioSession/AudioSession.swift index 6bcc55051..781c481fd 100644 --- a/apple/OmnivoreKit/Sources/Services/AudioSession/AudioSession.swift +++ b/apple/OmnivoreKit/Sources/Services/AudioSession/AudioSession.swift @@ -296,8 +296,8 @@ public class AudioSession: NSObject, ObservableObject, AVAudioPlayerDelegate { if let item = item { MPNowPlayingInfoCenter.default().nowPlayingInfo = [ - MPMediaItemPropertyTitle: NSString(string: item.title!), - MPMediaItemPropertyArtist: NSString(string: item.author!), + MPMediaItemPropertyTitle: NSString(string: item.title ?? "Your Omnivore Article"), + MPMediaItemPropertyArtist: NSString(string: item.author ?? "Omnivore"), MPMediaItemPropertyPlaybackDuration: NSNumber(value: duration), MPNowPlayingInfoPropertyElapsedPlaybackTime: NSNumber(value: timeElapsed) ]