ProjectExplorer: Do not crash when setting custom executable

Do not crash when setting custom executable without ever visiting
the runconfiguration before.

At that point the chooser is still a nullptr.

Task-number: QTCREATORBUG-17505
Change-Id: I27fb19845adf9c7ec0ad5a9435c8d86a573a2532
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2017-01-04 17:14:48 +01:00
parent 86af16725d
commit be4d1093b4

View File

@@ -258,7 +258,7 @@ PathChooser *WorkingDirectoryAspect::pathChooser() const
*/
ArgumentsAspect::ArgumentsAspect(RunConfiguration *runConfig, const QString &key, const QString &arguments)
: IRunConfigurationAspect(runConfig), m_arguments(arguments), m_chooser(0), m_key(key)
: IRunConfigurationAspect(runConfig), m_arguments(arguments), m_key(key)
{
setDisplayName(tr("Arguments"));
setId("ArgumentsAspect");
@@ -280,7 +280,7 @@ void ArgumentsAspect::setArguments(const QString &arguments)
m_arguments = arguments;
emit argumentsChanged(arguments);
}
if (m_chooser->text() != arguments)
if (m_chooser && m_chooser->text() != arguments)
m_chooser->setText(arguments);
}