diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qprocess.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index a9d8ee2..f16f996 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1601,6 +1601,13 @@ static QStringList parseCombinedArgString(const QString &program) void QProcess::start(const QString &program, OpenMode mode) { QStringList args = parseCombinedArgString(program); + if (args.isEmpty()) { + Q_D(QProcess); + d->processError = QProcess::FailedToStart; + setErrorString(tr("No program defined")); + emit error(d->processError); + return; + } QString prog = args.first(); args.removeFirst(); @@ -1769,6 +1776,8 @@ bool QProcess::startDetached(const QString &program, bool QProcess::startDetached(const QString &program) { QStringList args = parseCombinedArgString(program); + if (args.isEmpty()) + return false; QString prog = args.first(); args.removeFirst(); |