From 283d89b5a9fac5f3e7c1a801696dab7448395453 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 30 Jun 2022 00:12:37 +0200 Subject: [PATCH] Fix another crash --- Model/Player/PlayerModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index 8a625d17..6091e21b 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -507,7 +507,9 @@ final class PlayerModel: ObservableObject { Windows.player.window?.title = windowTitle #endif - Defaults[.lastPlayed] = currentItem + DispatchQueue.main.async(qos: .background) { [weak self] in + Defaults[.lastPlayed] = self?.currentItem + } } #if os(macOS)