From 925360ebd92dd5ed271011f8b8f2a642edeea6dc Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 29 Jun 2022 23:57:42 +0200 Subject: [PATCH] Fix crash on unloadable history items --- Model/Player/PlayerQueue.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Model/Player/PlayerQueue.swift b/Model/Player/PlayerQueue.swift index 55b8a9c9..08b78b7a 100644 --- a/Model/Player/PlayerQueue.swift +++ b/Model/Player/PlayerQueue.swift @@ -163,13 +163,15 @@ extension PlayerModel { } func playHistory(_ item: PlayerQueueItem, at time: CMTime? = nil) { + guard let video = item.video else { return } + var time = time ?? item.playbackTime if item.shouldRestartPlaying { time = .zero } - let newItem = enqueueVideo(item.video, atTime: time, prepending: true) + let newItem = enqueueVideo(video, atTime: time, prepending: true) advanceToItem(newItem!) }