ProjectExplorer: Avoid nullptr access

The path chooser for the compiler command is
initialized only for manually defined compilers.
Skip the call to apply() on the options page
when processing auto-detected toolchains to
avoid a crash.

Change-Id: Ib795d233f0372ef74e42b323544b0bbd95c27646
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2019-04-12 11:16:35 +02:00
parent a5ee354b19
commit c65f5ee3c2

View File

@@ -463,7 +463,7 @@ void ToolChainOptionsWidget::apply()
for (TreeItem *item : *parent) {
auto tcItem = static_cast<ToolChainTreeItem *>(item);
Q_ASSERT(tcItem->toolChain);
if (tcItem->widget)
if (!tcItem->toolChain->isAutoDetected() && tcItem->widget)
tcItem->widget->apply();
tcItem->changed = false;
tcItem->update();