From 1fdfc153bede248f82fd652b005e31179b3cd68b Mon Sep 17 00:00:00 2001 From: Xavier Valls Date: Sat, 15 May 2021 15:11:19 +0200 Subject: [PATCH] Fix unreachable setting of file permissions (#6514) Fixes #6080 --- src/core/Database.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/Database.cpp b/src/core/Database.cpp index ccd0ffb21..be9adfa45 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -486,8 +486,9 @@ bool Database::restoreDatabase(const QString& filePath) // Only try to restore if the backup file actually exists if (QFile::exists(backupFilePath)) { QFile::remove(filePath); - return QFile::copy(backupFilePath, filePath); - QFile::setPermissions(filePath, perms); + if (QFile::copy(backupFilePath, filePath)) { + return QFile::setPermissions(filePath, perms); + } } return false; }