diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2016-03-24 11:03:25 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2016-03-24 16:05:26 +0000 |
commit | fb137ade7d93955a930ca9ba21f55dfd6b599f08 (patch) | |
tree | 6dd195beafec06fcd11365dc5116a8bfeaa356b3 | |
parent | 0fda5b635469ed7df20fa4ea0b05605b12f63cbc (diff) | |
download | qt-creator-fb137ade7d93955a930ca9ba21f55dfd6b599f08.tar.gz |
Fix crash in VariableChooser
fce83bd9f84883f93829e6ca9eacf098b018a02d in qtbase causes a crash:
setModel creates a new selection model, which calls currentChanged,
which accesses an uninitialized member. Hence, protect the access to it.
Change-Id: I144f40aa4286f1a9edba24519a30c08ff5091f57
Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r-- | src/plugins/coreplugin/variablechooser.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp index 09aa1c8c4a..92b1caa7f7 100644 --- a/src/plugins/coreplugin/variablechooser.cpp +++ b/src/plugins/coreplugin/variablechooser.cpp @@ -245,7 +245,10 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent) : q(parent), m_lineEdit(0), m_textEdit(0), - m_plainTextEdit(0) + m_plainTextEdit(0), + m_iconButton(0), + m_variableTree(0), + m_variableDescription(0) { m_defaultDescription = VariableChooser::tr("Select a variable to insert."); @@ -408,7 +411,8 @@ void VariableChooser::addSupportForChildWidgets(QWidget *parent, MacroExpander * */ void VariableChooserPrivate::updateDescription(const QModelIndex &index) { - m_variableDescription->setText(m_model.data(index, Qt::ToolTipRole).toString()); + if (m_variableDescription) + m_variableDescription->setText(m_model.data(index, Qt::ToolTipRole).toString()); } /*! |