From 166207753c85d7295208989cd446399f5e833c01 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 5 Sep 2024 09:36:45 +0300 Subject: [PATCH] ensure that the shortcut destination exists Signed-off-by: Trial97 --- launcher/FileSystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index b5c2c95cf..7f38cff04 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -921,6 +921,10 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri if (destination.isEmpty()) { destination = PathCombine(getDesktopDir(), RemoveInvalidFilenameChars(name)); } + if (!ensureFilePathExists(destination)) { + qWarning() << "Destination path can't be created!"; + return false; + } #if defined(Q_OS_MACOS) // Create the Application QDir applicationDirectory =