diff --git a/HardcoreData/AsynchronousDataTransaction.swift b/HardcoreData/AsynchronousDataTransaction.swift index a3e605e..423b687 100644 --- a/HardcoreData/AsynchronousDataTransaction.swift +++ b/HardcoreData/AsynchronousDataTransaction.swift @@ -152,7 +152,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction { self.transactionQueue.async { self.closure(transaction: self) - if !self.isCommitted { + if !self.isCommitted && self.hasChanges { HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.") } @@ -164,7 +164,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction { self.transactionQueue.sync { self.closure(transaction: self) - if !self.isCommitted { + if !self.isCommitted && self.hasChanges { HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.") } diff --git a/HardcoreData/SynchronousDataTransaction.swift b/HardcoreData/SynchronousDataTransaction.swift index 02bde8d..c293f9e 100644 --- a/HardcoreData/SynchronousDataTransaction.swift +++ b/HardcoreData/SynchronousDataTransaction.swift @@ -103,7 +103,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction { self.transactionQueue.sync { self.closure(transaction: self) - if !self.isCommitted { + if !self.isCommitted && self.hasChanges { HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.") }