diff --git a/Sources/Classes/RSDBPersistentManager.m b/Sources/Classes/RSDBPersistentManager.m index 35e11caf..77ff0eb2 100644 --- a/Sources/Classes/RSDBPersistentManager.m +++ b/Sources/Classes/RSDBPersistentManager.m @@ -79,17 +79,13 @@ - (void)createDB:(RSDBEncryption * __nullable)dbEncryption { // open unencrypted database [self openUnencryptedDB]; } - return; - } - + } else if (isEncryptedDBExists) { // when only encrypted db exists - if (isEncryptedDBExists) { [self handleWhenEncryptedDBExists:dbEncryption isEncryptionNeeded:isEncryptionNeeded]; - return; + } else { + // when only unencrypted db exists + [self handleWhenUnencryptedDBExists:dbEncryption isEncryptionNeeded:isEncryptionNeeded]; } - - // when only unencrypted db exists - [self handleWhenUnencryptedDBExists:dbEncryption isEncryptionNeeded:isEncryptionNeeded]; } - (BOOL)isEncryptionNeeded:(RSDBEncryption * __nullable)dbEncryption {