Skip to content

Commit b13a96f

Browse files
committed
Abort cookie jar migraion if it exists on new path
1 parent 3117b43 commit b13a96f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libsync/account.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,11 @@ void Account::tryMigrateCookieJar()
393393
QString oldCookieJarPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/cookies" + id() + ".db";
394394
if (QFile::exists(oldCookieJarPath))
395395
{
396+
if (QFile::exists(cookieJarPath()))
397+
{
398+
qWarning() << "Both old cookie jar and new cookie jar exists. Abort migration";
399+
return;
400+
}
396401
qDebug() << "Migrating cookie jar from "<< oldCookieJarPath << "to " << cookieJarPath();
397402
if (!QFile::rename(oldCookieJarPath, cookieJarPath()))
398403
qWarning() << "Failed to migrate cookie jar";

0 commit comments

Comments
 (0)