diff --git a/PVLibrary/Sources/PVRealm/RealmPlatform/Entities/Files/PVFile.swift b/PVLibrary/Sources/PVRealm/RealmPlatform/Entities/Files/PVFile.swift index f61d5f4608..8384d54516 100644 --- a/PVLibrary/Sources/PVRealm/RealmPlatform/Entities/Files/PVFile.swift +++ b/PVLibrary/Sources/PVRealm/RealmPlatform/Entities/Files/PVFile.swift @@ -186,7 +186,7 @@ public extension PVFile { fileSize = attr.fileSize() // Cache the size only if we're not frozen - if !self.isFrozen, let realm = self.realm { + if !self.isFrozen, let realm = self.realm, !realm.isInWriteTransaction { do { try realm.write { self.sizeCache = Int(fileSize)