From 773cb1e55d3f10ab59fdeb8316545a12bdc8c5c0 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 11 Mar 2024 13:02:51 +0800 Subject: [PATCH] Ensure the profile path is pointing to a directory Closes #20513. PR #20519. --- src/app/application.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/application.cpp b/src/app/application.cpp index e72e5ef09..bfb925915 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -257,11 +257,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));