- Fix: DatabaseManager.migrateDatabaseToAppGroupIfNeeded() src and dest for replaceAt() cannot be same

This commit is contained in:
Magesh K
2024-11-04 12:33:53 +05:30
parent 948a8eb90b
commit a2bb26a86e

View File

@@ -407,7 +407,10 @@ private extension DatabaseManager
// Migrate apps
if FileManager.default.fileExists(atPath: previousAppsDirectoryURL.path, isDirectory: nil)
{
_ = try FileManager.default.replaceItemAt(appsDirectoryURL, withItemAt: previousAppsDirectoryURL)
if(previousAppsDirectoryURL.path != appsDirectoryURL.path)
{
_ = try FileManager.default.replaceItemAt(appsDirectoryURL, withItemAt: previousAppsDirectoryURL)
}
}
finish(.success(()))