From be4d1093b468b71638dd3aeaf2149c4bfe8b9842 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 4 Jan 2017 17:14:48 +0100 Subject: 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 --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/projectexplorer/runconfigurationaspects.cpp') diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 4ba7eb35bd..270e600c1d 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -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); } -- cgit v1.2.3