project-imas / encrypted-core-data

v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
Other
785 stars 236 forks source link

empty save causes error #252

Open pteasima opened 8 years ago

pteasima commented 8 years ago

Hi, I'm using an EncryptedStore with MagicalRecord. Everything is working fine and I'm able to use the NSManagedObjectContext.MR_saveWithBlock method. However, if I dont make any changes inside the block, the save operation throws the following error:

<NSManagedObjectContext: 0x799978e0>
Error Domain=NSSQLiteErrorDomain Code=1 "(null)" UserInfo={EncryptedStoreErrorMessage=near ")": syntax error}

Not making any changes doesnt really make sense, I stumbled upon this when I forgot to check whether an array of managed objects was empty before attempting to save it. Still, the default unencrypted store doesn't trigger this error under the same circumstances, so you might want to fix this.