From 9673a5571cb2de4bd770ba79fe6e520fecdd54ed Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 5 May 2025 10:49:01 +0100 Subject: [PATCH] Don't silently drop working directory, print error if it doesn't exist --- qrenderdoc/Windows/Dialogs/CaptureDialog.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp index a9c1ea5e0..8e184a9d1 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.cpp @@ -1221,17 +1221,18 @@ void CaptureDialog::TriggerCapture() } } - QString workingDir; + QString workingDir = ui->workDirPath->text(); // for non-remote captures, check the directory locally - if(m_Ctx.Replay().CurrentRemote().IsValid()) + if(!m_Ctx.Replay().CurrentRemote().IsValid()) { - workingDir = ui->workDirPath->text(); - } - else - { - if(QDir(ui->workDirPath->text()).exists()) - workingDir = ui->workDirPath->text(); + if(!QDir(ui->workDirPath->text()).exists()) + { + RDDialog::critical( + this, tr("Invalid working directory"), + tr("Invalid working directory: %1\nThis path does not exist").arg(workingDir)); + return; + } } QString cmdLine = GetCommandLine();