ShellCommand: Do not crash when no binary is given

Task-number: QTCREATORBUG-14643
Change-Id: I9c62904c271e2c2a94785dd8223b60d588da822b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-06-30 15:40:30 +02:00
parent 0b31635a32
commit 3652ca52bc

View File

@@ -159,7 +159,10 @@ QString ShellCommand::displayName() const
if (!d->m_jobs.isEmpty()) {
const Internal::ShellCommandPrivate::Job &job = d->m_jobs.at(0);
QString result = job.binary.toFileInfo().baseName();
result[0] = result.at(0).toTitleCase();
if (!result.isEmpty())
result[0] = result.at(0).toTitleCase();
else
result = tr("UNKNOWN");
if (!job.arguments.isEmpty())
result += QLatin1Char(' ') + job.arguments.at(0);