From b72857b187378ac775d43e8d498d8a93d7067805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Thu, 23 Jan 2025 10:13:34 +0100 Subject: [PATCH] fix(FileCollectionViewCell): Invalidated realm object in async closure --- kDrive/UI/View/Files/FileCollectionViewCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/kDrive/UI/View/Files/FileCollectionViewCell.swift b/kDrive/UI/View/Files/FileCollectionViewCell.swift index 23901692f..6ca50d051 100644 --- a/kDrive/UI/View/Files/FileCollectionViewCell.swift +++ b/kDrive/UI/View/Files/FileCollectionViewCell.swift @@ -125,6 +125,7 @@ protocol FileCellDelegate: AnyObject { .observeFileDownloadProgress(self, fileId: file.id) { [weak self] _, progress in Task { @MainActor [weak self] in guard let self else { return } + guard !file.isInvalidated else { return } handler(!file.isAvailableOffline || progress < 1, progress >= 1 || progress == 0, progress) } }