diff --git a/src/base/settingsstorage.cpp b/src/base/settingsstorage.cpp index ed7071877..da3c9d374 100644 --- a/src/base/settingsstorage.cpp +++ b/src/base/settingsstorage.cpp @@ -188,10 +188,13 @@ bool SettingsStorage::writeNativeSettings() const break; } + const Path newPath {nativeSettings->fileName()}; if (nativeSettings->status() != QSettings::NoError) + { + Utils::Fs::removeFile(newPath); return false; + } - const Path newPath {nativeSettings->fileName()}; QString finalPathStr = newPath.data(); const int index = finalPathStr.lastIndexOf(u"_new", -1, Qt::CaseInsensitive); finalPathStr.remove(index, 4);