diff options
author | Christian Stenger <christian.stenger@qt.io> | 2019-02-13 15:38:58 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2019-02-14 05:42:47 +0000 |
commit | 75d9b56c1a6739c39a0cd12cba1db7d4bd479778 (patch) | |
tree | 73252703753c91e400b75dbc374b7d9728826615 /src/plugins/qmljseditor | |
parent | 667eb57169dfb0785baddf85d7889122f11d8f3e (diff) |
QmlJSEditor: Fix nullptr access
Avoids a crash when triggering 'Find Usage' on a Qml Item.
Change-Id: I3980e6a7aae891f853148017341a2f29a07e03ad
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r-- | src/plugins/qmljseditor/qmljsfindreferences.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index 67abdece26..8b790c3351 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -322,10 +322,12 @@ protected: bool visit(AST::UiPublicMember *node) override { - if (node->memberType->name == _name){ - const ObjectValue * tVal = _context->lookupType(_doc.data(), QStringList(_name)); - if (tVal == _typeValue) - _usages.append(node->typeToken); + if (UiQualifiedId *memberType = node->memberType) { + if (memberType->name == _name) { + const ObjectValue * tVal = _context->lookupType(_doc.data(), QStringList(_name)); + if (tVal == _typeValue) + _usages.append(node->typeToken); + } } if (AST::cast<Block *>(node->statement)) { _builder.push(node); |