From 09490a94b236cd94d229e6b33fb1e629e2bcab52 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)