Ensure the profile path is pointing to a directory

Closes #20513.
PR #20519.
This commit is contained in:
Chocobo1 2024-03-11 13:02:51 +08:00 committed by sledgehammer999
parent cce1290c0c
commit 18296b2f75
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -264,11 +264,8 @@ Application::Application(int &argc, char **argv)
Logger::initInstance();
const auto portableProfilePath = Path(QCoreApplication::applicationDirPath()) / DEFAULT_PORTABLE_MODE_PROFILE_DIR;
const bool portableModeEnabled = m_commandLineArgs.profileDir.isEmpty() && portableProfilePath.exists();
const Path profileDir = portableModeEnabled
? portableProfilePath
: m_commandLineArgs.profileDir;
const bool portableModeEnabled = m_commandLineArgs.profileDir.isEmpty() && Utils::Fs::isDir(portableProfilePath);
const Path profileDir = portableModeEnabled ? portableProfilePath : m_commandLineArgs.profileDir;
Profile::initInstance(profileDir, m_commandLineArgs.configurationName,
(m_commandLineArgs.relativeFastresumePaths || portableModeEnabled));